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:
authorJoshua Leung <aligorith@gmail.com>2008-11-30 09:15:33 +0300
committerJoshua Leung <aligorith@gmail.com>2008-11-30 09:15:33 +0300
commit43b26b72ab0df5ff8bbdb7e30c761099b95385a6 (patch)
tree07457dfbcfb633975e36c67482c5743b9836025a /source/blender/makesdna/DNA_view2d_types.h
parent970fa83fab52387aa3f9aa0f3e90d73b5af52bfd (diff)
View2D - Initial commit of Pan-View Operator
* Moved View2D data from space-data to ARegion (aka regions). This has been done because drawing occurs in regions not areas anymore. The View2D struct is currently stored in the ARegion struct (not as pointer), given that most of the regions in use will be 2D anyway (only the 3d-view's "window" region is the exception). Added version patch code for outliner and timeline only for now. Headers are also likely to need this. * Added separate keymap for View2D operators. All regions that use View2D will need this added. This includes headers too. * Pan view operator (ED_View2D_OT_view_pan), currently works for Outliner and Timeline. Use MMB-drag as before. - It currently doesn't exposed any parameters for redo (via RNA-ID-Props), but only uses some customdata. Suggestions on what these parameters could be are welcomed. - I've yet to implement the necessary axis-locking features for this panning (which is required in Timeline for example to prevent vertical panning, which moves the markers out of view).
Diffstat (limited to 'source/blender/makesdna/DNA_view2d_types.h')
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index d4425b43f76..0a44b6b8759 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -37,17 +37,21 @@
/* View 2D data - stored per region */
typedef struct View2D {
- rctf tot, cur;
- rcti vert, hor, mask;
+ rctf tot, cur; /* tot - area that data can be drawn in; cur - region of tot that is visible in viewport */
+ rcti vert, hor; /* vert - vertical scrollbar region; hor - horizontal scrollbar region */
+ rcti mask; /* mask - region (in screenspace) within which 'cur' can be viewed */
- float min[2], max[2];
- float minzoom, maxzoom;
+ float min[2], max[2]; /* min/max sizes? */
+ float minzoom, maxzoom; /* self explanatory. allowable zoom factor range */
- short scroll, keeptot; /* scroll - scrollbars to display (bitflag); keeptot - 'tot' rect */
- short keepaspect, keepzoom;
- short oldwinx, oldwiny;
+ short scroll; /* scroll - scrollbars to display (bitflag) */
+ short keeptot; /* keeptot - 'tot' rect */
+ short keepaspect, keepzoom; /* axes that zoomimg cannot occur on, and need to maintain aspect ratio */
+ short keepofs; /* keepofs - axes that translation is not allowed to occur on */
- int flag; /* settings */
+ short flag; /* settings */
+
+ short oldwinx, oldwiny; /* storage of previous winx/winy values encountered by UI_view2d_enforce_status(), for keepaspect */
float cursor[2]; /* only used in the UV view for now (for 2D-cursor) */
short around; /* pivot point for transforms (rotate and scale) */
@@ -61,6 +65,10 @@ typedef struct View2D {
#define V2D_LOCKZOOM_X 0x0100
#define V2D_LOCKZOOM_Y 0x0200
+/* v2d->keepofs */
+#define V2D_LOCKOFS_X (1<<1)
+#define V2D_LOCKOFS_Y (1<<2)
+
/* event codes for locking function */
#define V2D_LOCK_COPY 1
#define V2D_LOCK_REDRAW 2