diff options
author | Ton Roosendaal <ton@blender.org> | 2009-07-19 15:13:15 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-07-19 15:13:15 +0400 |
commit | 08ef73ab3ea9b9758c47eb0658eb0490f19b5ffd (patch) | |
tree | 760d815d0c18b9b9c34e2238cf1c0e0ad13040ea /source/blender/editors/screen | |
parent | 1917e951ca4cb593399158f5b9222708dbb66f24 (diff) |
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.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 6da00f12a25..e7a61514010 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -603,6 +603,21 @@ void select_connected_scredge(bScreen *sc, ScrEdge *edge) } } +/* 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 @@ static void screen_test_scale(bScreen *sc, int winsizex, int winsizey) 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... */ |