Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-30 02:57:53 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-30 02:57:53 +0400
commit408ba429e6aa392f769aac4a442a7a06c1740326 (patch)
tree63ae81d4fd4799cf3d6e4afd444681c6fc5ea1d3 /source/blender/makesdna/DNA_view2d_types.h
parent2df1eeba0e212fe551f2e4cbfe222bd36026670f (diff)
2.5: Buttons View
* When resizing the window, the top position is now preserved, instead of the center position. * Fix zoom level not being preserved in various cases, when changing both with and height. This replaces some earlier code which did this at screen level but wasn't very reliable. * Different tabs now each preserve their own scroll. * When switching between tabs, it now scrolls to show as many buttons as possible, instead of possibly showing empty space. There is a trade-off here between doing that keeping the buttons in the same place, no ideal solution exists I think. * Change zooming in/out to be symmetric, for example doing numpad + then - did not give the original zoom level back. * Added some calls to avoid hanging tooltips when manipulating the view. Internals: * Added V2D_KEEPOFS_X and V2D_KEEPOFS_Y to keep the top/bottom rather than the center. * Renamed V2D_KEEPZOOM to V2D_LIMITZOOM (seems more appropriate), and make V2D_KEEPZOOM preserve the zoom level.
Diffstat (limited to 'source/blender/makesdna/DNA_view2d_types.h')
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index dd73d691b62..bc019ef8121 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -59,15 +59,21 @@ typedef struct View2D {
short around; /* pivot point for transforms (rotate and scale) */
float cursor[2]; /* only used in the UV view for now (for 2D-cursor) */
+
+ float *tab_offset; /* different offset per tab, for buttons */
+ int tab_num; /* number of tabs stored */
+ int tab_cur; /* current tab */
} View2D;
/* ---------------------------------- */
/* view zooming restrictions, per axis (v2d->keepzoom) */
/* zoom is clamped to lie within limits set by minzoom and maxzoom */
-#define V2D_KEEPZOOM 0x0001
+#define V2D_LIMITZOOM 0x0001
/* aspect ratio is maintained on view resize */
#define V2D_KEEPASPECT 0x0002
+ /* zoom is kept when the window resizes */
+#define V2D_KEEPZOOM 0x0004
/* zooming on x-axis is not allowed */
#define V2D_LOCKZOOM_X 0x0100
/* zooming on y-axis is not allowed */
@@ -78,6 +84,10 @@ typedef struct View2D {
#define V2D_LOCKOFS_X (1<<1)
/* panning on y-axis is not allowed */
#define V2D_LOCKOFS_Y (1<<2)
+ /* on resize, keep the x offset */
+#define V2D_KEEPOFS_X (1<<3)
+ /* on resize, keep the y offset */
+#define V2D_KEEPOFS_Y (1<<4)
/* view extent restrictions (v2d->keeptot) */
/* 'cur' view can be out of extents of 'tot' */