[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59793] trunk/blender/source/blender/ editors/screen: fix for glitch splitting horizontally with a high dpi, could make areas smaller then the header which pushed the original view out of the screen .

Campbell Barton ideasman42 at gmail.com
Wed Sep 4 05:52:25 CEST 2013


Revision: 59793
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59793
Author:   campbellbarton
Date:     2013-09-04 03:52:25 +0000 (Wed, 04 Sep 2013)
Log Message:
-----------
fix for glitch splitting horizontally with a high dpi, could make areas smaller then the header which pushed the original view out of the screen.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/screen/area.c
    trunk/blender/source/blender/editors/screen/screen_edit.c

Modified: trunk/blender/source/blender/editors/screen/area.c
===================================================================
--- trunk/blender/source/blender/editors/screen/area.c	2013-09-04 03:30:41 UTC (rev 59792)
+++ trunk/blender/source/blender/editors/screen/area.c	2013-09-04 03:52:25 UTC (rev 59793)
@@ -1806,7 +1806,7 @@
 /* UI_UNIT_Y is defined as U variable now, depending dpi */
 int ED_area_headersize(void)
 {
-	return (int)(1.3f * UI_UNIT_Y);
+	return (int)(HEADERY * UI_DPI_FAC);
 }
 
 void ED_region_info_draw(ARegion *ar, const char *text, int block, float fill_color[4])

Modified: trunk/blender/source/blender/editors/screen/screen_edit.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screen_edit.c	2013-09-04 03:30:41 UTC (rev 59792)
+++ trunk/blender/source/blender/editors/screen/screen_edit.c	2013-09-04 03:52:25 UTC (rev 59793)
@@ -327,10 +327,12 @@
 static short testsplitpoint(ScrArea *sa, char dir, float fac)
 {
 	short x, y;
+	const short area_min_x = AREAMINX;
+	const short area_min_y = ED_area_headersize();
 	
 	// area big enough?
-	if (dir == 'v' && (sa->v4->vec.x - sa->v1->vec.x <= 2 * AREAMINX)) return 0;
-	if (dir == 'h' && (sa->v2->vec.y - sa->v1->vec.y <= 2 * AREAMINY)) return 0;
+	if (dir == 'v' && (sa->v4->vec.x - sa->v1->vec.x <= 2 * area_min_x)) return 0;
+	if (dir == 'h' && (sa->v2->vec.y - sa->v1->vec.y <= 2 * area_min_y)) return 0;
 	
 	// to be sure
 	CLAMP(fac, 0.0f, 1.0f);
@@ -338,10 +340,10 @@
 	if (dir == 'h') {
 		y = sa->v1->vec.y + fac * (sa->v2->vec.y - sa->v1->vec.y);
 		
-		if (y - sa->v1->vec.y < AREAMINY)
-			y = sa->v1->vec.y + AREAMINY;
-		else if (sa->v2->vec.y - y < AREAMINY)
-			y = sa->v2->vec.y - AREAMINY;
+		if (y - sa->v1->vec.y < area_min_y)
+			y = sa->v1->vec.y + area_min_y;
+		else if (sa->v2->vec.y - y < area_min_y)
+			y = sa->v2->vec.y - area_min_y;
 		else y -= (y % AREAGRID);
 		
 		return y;
@@ -349,10 +351,10 @@
 	else {
 		x = sa->v1->vec.x + fac * (sa->v4->vec.x - sa->v1->vec.x);
 		
-		if (x - sa->v1->vec.x < AREAMINX)
-			x = sa->v1->vec.x + AREAMINX;
-		else if (sa->v4->vec.x - x < AREAMINX)
-			x = sa->v4->vec.x - AREAMINX;
+		if (x - sa->v1->vec.x < area_min_x)
+			x = sa->v1->vec.x + area_min_x;
+		else if (sa->v4->vec.x - x < area_min_x)
+			x = sa->v4->vec.x - area_min_x;
 		else x -= (x % AREAGRID);
 		
 		return x;




More information about the Bf-blender-cvs mailing list