[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54437] trunk/blender/source/blender: Fix a few DPI / retina draw issues:

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Feb 10 19:03:01 CET 2013


Revision: 54437
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54437
Author:   blendix
Date:     2013-02-10 18:03:01 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_widgets.c
    trunk/blender/source/blender/editors/space_buttons/buttons_header.c
    trunk/blender/source/blender/windowmanager/intern/wm_gesture.c

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-02-10 18:02:59 UTC (rev 54436)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-02-10 18:03:01 UTC (rev 54437)
@@ -646,8 +646,8 @@
 	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 @@
 	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 @@
 
 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);

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_header.c
===================================================================
--- trunk/blender/source/blender/editors/space_buttons/buttons_header.c	2013-02-10 18:02:59 UTC (rev 54436)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_header.c	2013-02-10 18:03:01 UTC (rev 54437)
@@ -97,14 +97,15 @@
 	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);
 	

Modified: trunk/blender/source/blender/windowmanager/intern/wm_gesture.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_gesture.c	2013-02-10 18:02:59 UTC (rev 54436)
+++ trunk/blender/source/blender/windowmanager/intern/wm_gesture.c	2013-02-10 18:03:01 UTC (rev 54437)
@@ -309,17 +309,19 @@
 static void wm_gesture_draw_cross(wmWindow *win, wmGesture *gt)
 {
 	rcti *rect = (rcti *)gt->customdata;
-	
+	int winsizex = WM_window_pixels_x(win);
+	int winsizey = WM_window_pixels_y(win);
+
 	glEnable(GL_LINE_STIPPLE);
 	glColor3ub(96, 96, 96);
 	glLineStipple(1, 0xCCCC);
-	sdrawline(rect->xmin - win->sizex, rect->ymin, rect->xmin + win->sizex, rect->ymin);
-	sdrawline(rect->xmin, rect->ymin - win->sizey, rect->xmin, rect->ymin + win->sizey);
+	sdrawline(rect->xmin - winsizex, rect->ymin, rect->xmin + winsizex, rect->ymin);
+	sdrawline(rect->xmin, rect->ymin - winsizey, rect->xmin, rect->ymin + winsizey);
 	
 	glColor3ub(255, 255, 255);
 	glLineStipple(1, 0x3333);
-	sdrawline(rect->xmin - win->sizex, rect->ymin, rect->xmin + win->sizex, rect->ymin);
-	sdrawline(rect->xmin, rect->ymin - win->sizey, rect->xmin, rect->ymin + win->sizey);
+	sdrawline(rect->xmin - winsizex, rect->ymin, rect->xmin + winsizex, rect->ymin);
+	sdrawline(rect->xmin, rect->ymin - winsizey, rect->xmin, rect->ymin + winsizey);
 	glDisable(GL_LINE_STIPPLE);
 }
 




More information about the Bf-blender-cvs mailing list