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/blenloader
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/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index bdb98a8ae72..3029e482312 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4681,6 +4681,9 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
}
}
+ ar->v2d.tab_offset= NULL;
+ ar->v2d.tab_num= 0;
+ ar->v2d.tab_cur= 0;
ar->handlers.first= ar->handlers.last= NULL;
ar->uiblocks.first= ar->uiblocks.last= NULL;
ar->headerstr= NULL;
@@ -5654,7 +5657,7 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb)
/* initialise view2d data for header region, to allow panning */
/* is copy from ui_view2d.c */
- ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+ ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
ar->v2d.keepofs = V2D_LOCKOFS_Y;
ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
@@ -5847,7 +5850,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
memcpy(&ar->v2d, &snode->v2d, sizeof(View2D));
ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
- ar->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT;
+ ar->v2d.keepzoom= V2D_LIMITZOOM|V2D_KEEPASPECT;
break;
}
case SPACE_BUTS:
@@ -5868,7 +5871,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->regiontype= RGN_TYPE_WINDOW;
ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM_O);
ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
- ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+ ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
break;
}
case SPACE_TEXT:
@@ -8199,7 +8202,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
simasel->v2d.minzoom= 0.5f;
simasel->v2d.maxzoom= 1.21f;
simasel->v2d.scroll= 0;
- simasel->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT;
+ simasel->v2d.keepzoom= V2D_LIMITZOOM|V2D_KEEPASPECT;
simasel->v2d.keeptot= 0;
simasel->prv_h = 96;
simasel->prv_w = 96;