Partial fix T45156: scaling region crash

'ar->winy' may not be initialized, making regions zoom in (past limits)
and attempt to draw very large text (~10x10k size characters), often crashing.

Fix isn't complete since it only corrects factory startup.
This commit is contained in:
Campbell Barton 2015-06-29 16:44:18 +10:00 committed by Sergey Sharybin
parent adba575605
commit 5f864894a4
Notes: blender-bot 2023-02-14 08:59:07 +01:00
Referenced by issue #45156, Windows crashes when draging properities panel to open it
1 changed files with 3 additions and 2 deletions

View File

@ -127,8 +127,9 @@ void BLO_update_defaults_startup_blend(Main *bmain)
/* simple fix for 3d view properties scrollbar being not set to top */
if (ar->regiontype == RGN_TYPE_UI) {
ar->v2d.cur.ymax = ar->v2d.tot.ymax;
ar->v2d.cur.ymin = ar->v2d.cur.ymax - ar->winy;
float offset = ar->v2d.tot.ymax - ar->v2d.cur.ymax;
ar->v2d.cur.ymax += offset;
ar->v2d.cur.ymin += offset;
}
}
}