From 595be0fed560fd8f67fbb9f7768aa7279782d674 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 28 Jul 2004 00:21:11 +0000 Subject: [PATCH] Interface drawing tweaks: * Made the shaded ends of popup menus the right shape, when the button is aligned, connected to another button. Found by desoto, fix by desoto * Made the icons inside icon buttons scale up with zoom, rather than just sit down in the bottom-left corner. The scaling up is rather ugly - consider this a temporary measure until we can find a nicer solution, on the backburner for 2.35. Found once again by Bugmaster Desoto, fix by ton. --- source/blender/src/interface_draw.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c index e80953f084e..6e671d36610 100644 --- a/source/blender/src/interface_draw.c +++ b/source/blender/src/interface_draw.c @@ -147,6 +147,7 @@ static void ui_draw_icon(uiBut *but, BIFIconID icon) glRasterPos2f(xs, ys); if(but->aspect>1.1) glPixelZoom(1.0/but->aspect, 1.0/but->aspect); + else if(but->aspect<0.9) glPixelZoom(1.0/but->aspect, 1.0/but->aspect); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1079,6 +1080,7 @@ static void round_button_mid(float x1, float y1, float x2, float y2, float asp, static void ui_draw_round(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) { int align= (flag & UI_BUT_ALIGN); + int round_align_fix= 0; /* paper */ if(flag & UI_SELECT) { @@ -1094,45 +1096,55 @@ static void ui_draw_round(int type, int colorid, float asp, float x1, float y1, switch(align) { case UI_BUT_ALIGN_TOP: uiSetRoundBox(12); + round_align_fix= 4; round_button(x1, y1, x2, y2, asp, colorid); break; case UI_BUT_ALIGN_DOWN: uiSetRoundBox(3); + round_align_fix= 2; round_button(x1, y1, x2, y2, asp, colorid); break; case UI_BUT_ALIGN_LEFT: uiSetRoundBox(6); + round_align_fix= 6; round_button(x1, y1, x2, y2, asp, colorid); break; case UI_BUT_ALIGN_RIGHT: uiSetRoundBox(9); + round_align_fix= 0; round_button(x1, y1, x2, y2, asp, colorid); break; case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT: uiSetRoundBox(1); + round_align_fix= 0; round_button(x1, y1, x2, y2, asp, colorid); break; case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT: uiSetRoundBox(2); + round_align_fix= 2; round_button(x1, y1, x2, y2, asp, colorid); break; case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT: uiSetRoundBox(8); + round_align_fix= 0; round_button(x1, y1, x2, y2, asp, colorid); break; case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT: uiSetRoundBox(4); + round_align_fix= 4; round_button(x1, y1, x2, y2, asp, colorid); break; default: + round_align_fix= 0; round_button_mid(x1, y1, x2, y2, asp, colorid, align); break; } } else { uiSetRoundBox(15); + round_align_fix= 6; round_button(x1, y1, x2, y2, asp, colorid); } @@ -1163,7 +1175,7 @@ static void ui_draw_round(int type, int colorid, float asp, float x1, float y1, else BIF_ThemeColorShade(colorid, -10); // assuming its not inside alignment... if(x2-x1 > 24) { - uiSetRoundBox(6); + uiSetRoundBox(round_align_fix); glBegin(GL_POLYGON); gl_round_box(x2-16, y1+asp, x2-asp, y2-asp, 7.0); glEnd();