[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21694] branches/blender2.5/blender/source /blender/editors/screen/screen_edit.c: 2.5

Ton Roosendaal ton at blender.org
Sun Jul 19 13:13:15 CEST 2009


Revision: 21694
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21694
Author:   ton
Date:     2009-07-19 13:13:15 +0200 (Sun, 19 Jul 2009)

Log Message:
-----------
2.5

Requested UI feature: when scaling Blender window, the buttons view keeps
scale (in visible pixels) as previously. Also works for the .B25.blend, which
currently will show the buttons a bit too large for small screens... this 
because the .B25.blend was created on a 1920x1200 screen. Might need a config
inbetween... 1440x1080 or so? Or we make a couple of defaults later.

Additional feature could be to also scale the buttons area itself, but that
will change the entire screen layout too much, potentially giving bad issues
with extremer scaling.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c

Modified: branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c	2009-07-19 09:33:27 UTC (rev 21693)
+++ branches/blender2.5/blender/source/blender/editors/screen/screen_edit.c	2009-07-19 11:13:15 UTC (rev 21694)
@@ -603,6 +603,21 @@
 	}
 }
 
+/* helper call for below, correct buttons view */
+static void screen_test_scale_region(ListBase *regionbase, float facx, float facy)
+{
+	ARegion *ar;
+	
+	for(ar= regionbase->first; ar; ar= ar->next) {
+		if(ar->regiontype==RGN_TYPE_WINDOW) {
+			ar->v2d.cur.xmin *= facx;
+			ar->v2d.cur.xmax *= facx;
+			ar->v2d.cur.ymin *= facy;
+			ar->v2d.cur.ymax *= facy;
+		}
+	}
+}
+
 /* test if screen vertices should be scaled */
 static void screen_test_scale(bScreen *sc, int winsizex, int winsizey)
 {
@@ -653,6 +668,19 @@
 			
 			CLAMP(sv->vec.y, 0, winsizey);
 		}
+		
+		/* keep buttons view2d same size */
+		for(sa= sc->areabase.first; sa; sa= sa->next) {
+			SpaceLink *sl;
+			
+			if(sa->spacetype==SPACE_BUTS)
+				screen_test_scale_region(&sa->regionbase, facx, facy);
+			
+			for(sl= sa->spacedata.first; sl; sl= sl->next)
+				if(sl->spacetype==SPACE_BUTS)
+					screen_test_scale_region(&sl->regionbase, facx, facy);
+		}
+		
 	}
 	
 	/* test for collapsed areas. This could happen in some blender version... */





More information about the Bf-blender-cvs mailing list