Bugfix: new DPI-controlled UI size code was setting 'view2d re-init'
authorTon Roosendaal <ton@blender.org>
Sun, 5 Jun 2011 12:57:09 +0000 (12:57 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 5 Jun 2011 12:57:09 +0000 (12:57 +0000)
flag on ED_area_initialize(). This however was causing 2 problems;
- the view state got reset (popping window view back)
- the view2d operator polls failed (sliders didnt work)

This re-init was only needed for the headers though, limiting it
to these types of regions solves it.

source/blender/editors/screen/area.c
source/blender/editors/space_api/spacetypes.c

index 05214a63325dbc10945bd4c646c94878ae60a7f0..828699e85cecebb5928f70c039aba2407f279234 100644 (file)
@@ -967,8 +967,9 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
                        uiFreeBlocks(NULL, &ar->uiblocks);      
                }
                
-               /* rechecks all 2d matrices */
-               ar->v2d.flag &= ~V2D_IS_INITIALISED;
+               /* rechecks 2d matrix for header on dpi changing, do not do for other regions, it resets view && blocks view2d operator polls (ton) */
+               if(ar->regiontype==RGN_TYPE_HEADER)
+                       ar->v2d.flag &= ~V2D_IS_INITIALISED;
        }
 }
 
index 8d8cdcc7183368d6ce2187bf7a6b7dbd8ea05ae0..4f8cb8a57b2013984ec6c5c50b176e23ff6aa436 100644 (file)
@@ -70,6 +70,9 @@ void ED_spacetypes_init(void)
        const ListBase *spacetypes;
        SpaceType *type;
 
+       /* UI_UNIT_X is now a variable, is used in some spacetype inits? */
+       U.widget_unit= 20;
+       
        /* create space types */
        ED_spacetype_outliner();
        ED_spacetype_time();