diff options
author | Ton Roosendaal <ton@blender.org> | 2009-05-24 17:29:29 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-05-24 17:29:29 +0400 |
commit | ab407f6ac748225386c5f09685490d6df67916f8 (patch) | |
tree | f66ec462386dbfcc847f690551866bf2a3630c14 /source/blender/blenlib/intern/rct.c | |
parent | ef01c5bf0abda3893b3a7f075a3ab20f164d5081 (diff) |
2.5
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r-- | source/blender/blenlib/intern/rct.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index 48ba18515de..915a93e8e0b 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -88,17 +88,42 @@ void BLI_union_rcti(rcti *rct1, rcti *rct2) void BLI_init_rctf(rctf *rect, float xmin, float xmax, float ymin, float ymax) { - rect->xmin= xmin; - rect->xmax= xmax; - rect->ymin= ymin; - rect->ymax= ymax; + if(xmin <= xmax) { + rect->xmin= xmin; + rect->xmax= xmax; + } + else { + rect->xmax= xmin; + rect->xmin= xmax; + } + if(ymin <= ymax) { + rect->ymin= ymin; + rect->ymax= ymax; + } + else { + rect->ymax= ymin; + rect->ymin= ymax; + } } + void BLI_init_rcti(rcti *rect, int xmin, int xmax, int ymin, int ymax) { - rect->xmin= xmin; - rect->xmax= xmax; - rect->ymin= ymin; - rect->ymax= ymax; + if(xmin <= xmax) { + rect->xmin= xmin; + rect->xmax= xmax; + } + else { + rect->xmax= xmin; + rect->xmin= xmax; + } + if(ymin <= ymax) { + rect->ymin= ymin; + rect->ymax= ymax; + } + else { + rect->ymax= ymin; + rect->ymin= ymax; + } } void BLI_translate_rcti(rcti *rect, int x, int y) |