[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32861] trunk/blender/source/blender/ editors/screen/screen_edit.c: fix for #24428, commit r32757 broke menu bar display for some users [#24454] ( but not me for some reason).

Campbell Barton ideasman42 at gmail.com
Wed Nov 3 23:11:17 CET 2010


Revision: 32861
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32861
Author:   campbellbarton
Date:     2010-11-03 23:11:17 +0100 (Wed, 03 Nov 2010)

Log Message:
-----------
fix for #24428, commit r32757 broke menu bar display for some users [#24454] (but not me for some reason).
For now revert most of r32757.

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

Modified: trunk/blender/source/blender/editors/screen/screen_edit.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screen_edit.c	2010-11-03 21:23:02 UTC (rev 32860)
+++ trunk/blender/source/blender/editors/screen/screen_edit.c	2010-11-03 22:11:17 UTC (rev 32861)
@@ -608,10 +608,6 @@
 }
 
 /* test if screen vertices should be scaled */
-
-/* needed to alternate AREAGRID snapping else it shifts one way
- * to avoid this we should use floats at least during runtime [#24428]. */
-static char scale_alt_bool= 0;
 static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
 {
 	ScrVert *sv=NULL;
@@ -647,26 +643,22 @@
 		
 		/* make sure it fits! */
 		for(sv= sc->vertbase.first; sv; sv= sv->next) {
-			/* 0.1519 was 0.5f, but tweaked so resizing the window doesnt favor one direction
-			 * also note scale_alt_bool */
+			/* FIXME, this resizing logic is no good when resizing the window + redrawing [#24428]
+			 * need some way to store these as floats internally and re-apply from there. */
 			tempf= ((float)sv->vec.x)*facx;
-			sv->vec.x= (short)(tempf+0.1519);
+			sv->vec.x= (short)(tempf+0.5);
 			sv->vec.x+=  AREAGRID-2;
-			sv->vec.x-=  scale_alt_bool;
 			sv->vec.x-=  (sv->vec.x % AREAGRID); 
-			
+
 			CLAMP(sv->vec.x, 0, winsizex);
 			
-			tempf= ((float)sv->vec.y )*facy;
-			sv->vec.y= (short)(tempf+0.1519);
+			tempf= ((float)sv->vec.y)*facy;
+			sv->vec.y= (short)(tempf+0.5);
 			sv->vec.y+=  AREAGRID-2;
-			sv->vec.y-=  scale_alt_bool;
 			sv->vec.y-=  (sv->vec.y % AREAGRID); 
-			
+
 			CLAMP(sv->vec.y, 0, winsizey);
 		}
-
-		scale_alt_bool= scale_alt_bool ? 0:1;
 	}
 	
 	/* test for collapsed areas. This could happen in some blender version... */





More information about the Bf-blender-cvs mailing list