diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-10 22:03:01 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-10 22:03:01 +0400 |
commit | 14a0ff90bc8b2d376ceb0b94c6724529754616b0 (patch) | |
tree | 28a0b68d4c53de7801ee76ea6bf129b462cd8357 /source/blender/editors | |
parent | 8d4d27de9f0919c74fa629c287ba6678e79ce9a4 (diff) |
Fix a few DPI / retina draw issues:
* Color picker cursor was too small, and color cirle was not smooth enough.
* Border select gesture cross before first click did not reach to the border
of the window.
* Buttons were not drawing emboss properly (also for non-retina actually).
Note it doesn't draw entirely right for aligned buttons, but this was also
the case before it got broken.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_header.c | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 142ea5128c0..6735c8b173c 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -646,8 +646,8 @@ static void widget_verts_to_quad_strip_open(uiWidgetBase *wtb, const int totvert for (a = 0; a < totvert; a++) { quad_strip[a * 2][0] = wtb->outer_v[a][0]; quad_strip[a * 2][1] = wtb->outer_v[a][1]; - quad_strip[a * 2 + 1][0] = wtb->inner_v[a][0]; - quad_strip[a * 2 + 1][1] = wtb->inner_v[a][1]; + quad_strip[a * 2 + 1][0] = wtb->outer_v[a][0]; + quad_strip[a * 2 + 1][1] = wtb->outer_v[a][1] - 1.0f; } } @@ -1900,12 +1900,12 @@ static void ui_hsv_cursor(float x, float y) glTranslatef(x, y, 0.0f); glColor3f(1.0f, 1.0f, 1.0f); - glutil_draw_filled_arc(0.0f, M_PI * 2.0, 3.0f, 8); + glutil_draw_filled_arc(0.0f, M_PI * 2.0, 3.0f * U.pixelsize, 8); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); glColor3f(0.0f, 0.0f, 0.0f); - glutil_draw_lined_arc(0.0f, M_PI * 2.0, 3.0f, 12); + glutil_draw_lined_arc(0.0f, M_PI * 2.0, 3.0f * U.pixelsize, 12); glDisable(GL_BLEND); glDisable(GL_LINE_SMOOTH); @@ -1929,7 +1929,7 @@ void ui_hsvcircle_vals_from_pos(float *val_rad, float *val_dist, const rcti *rec static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *rect) { - const int tot = 32; + const int tot = 64; const float radstep = 2.0f * (float)M_PI / (float)tot; const float centx = BLI_rcti_cent_x_fl(rect); diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index ebba7d92819..701048cd229 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -97,14 +97,15 @@ static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event) sbuts->mainbuser = sbuts->mainb; } -#define BUT_UNIT_X (UI_UNIT_X + 2) +#define BUT_UNIT_X (UI_UNIT_X + 2*U.pixelsize) void buttons_header_buttons(const bContext *C, ARegion *ar) { SpaceButs *sbuts = CTX_wm_space_buts(C); uiBlock *block; uiBut *but; - int xco, yco = 2; + int headery = ED_area_headersize(); + int xco, yco = 0.5f*(headery - UI_UNIT_Y); buttons_context_compute(C, sbuts); |