Fix T42506 sequencer not limiting zoom.

Fix by Campbell thanks!
This commit is contained in:
Antonis Ryakiotakis 2015-02-26 14:26:42 +01:00
parent 60679a171d
commit 13c275ce84
Notes: blender-bot 2023-02-14 09:51:50 +01:00
Referenced by issue #42506, Infinite Zoom
3 changed files with 26 additions and 2 deletions

View File

@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 273
#define BLENDER_SUBVERSION 8
#define BLENDER_SUBVERSION 9
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
#define BLENDER_MINVERSION 270
#define BLENDER_MINSUBVERSION 5

View File

@ -629,4 +629,28 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
if (!MAIN_VERSION_ATLEAST(main, 273, 9)) {
bScreen *scr;
ScrArea *sa;
SpaceLink *sl;
ARegion *ar;
/* Make sure sequencer preview area limits zoom */
for (scr = main->screen.first; scr; scr = scr->id.next) {
for (sa = scr->areabase.first; sa; sa = sa->next) {
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_SEQ) {
for (ar = sl->regionbase.first; ar; ar = ar->next) {
if (ar->regiontype == RGN_TYPE_PREVIEW) {
ar->v2d.keepzoom |= V2D_LIMITZOOM;
break;
}
}
}
}
}
}
}
}

View File

@ -144,7 +144,7 @@ static SpaceLink *sequencer_new(const bContext *C)
ar->alignment = RGN_ALIGN_TOP;
ar->flag |= RGN_FLAG_HIDDEN;
/* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
ar->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM;
ar->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM | V2D_LIMITZOOM;
ar->v2d.minzoom = 0.00001f;
ar->v2d.maxzoom = 100000.0f;
ar->v2d.tot.xmin = -960.0f; /* 1920 width centered */