From ce3b49742decf64b3cb600dd2091feac07330b7b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 3 Nov 2010 22:11:17 +0000 Subject: [PATCH] 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. --- source/blender/editors/screen/screen_edit.c | 22 +++++++-------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index cd92c48f12a..a275de08356 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -608,10 +608,6 @@ void select_connected_scredge(bScreen *sc, ScrEdge *edge) } /* 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 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey) /* 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... */