From c79e57dba8f436e0b3a9b231f70a2ba121438907 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 27 Jun 2009 16:35:42 +0000 Subject: 2.5 Two bugfixes: - When making 2d windows small (zero sized) the view2d data could get corrupted with NaN values. Clipped values correctly to 1. - Search menu (ctrl+alt+f) had wrong color for selected text in text button --- source/blender/editors/interface/view2d.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors/interface/view2d.c') diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 4621be6eda0..aa5aa65d300 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -316,6 +316,12 @@ void UI_view2d_curRect_validate(View2D *v2d) if (v2d->keepzoom & V2D_LOCKZOOM_Y) height= winy; + /* values used to divide, so make it safe */ + if(width<1) width= 1; + if(height<1) height= 1; + if(winx<1) winx= 1; + if(winy<1) winy= 1; + /* keepzoom (V2D_KEEPZOOM set), indicates that zoom level on each axis must not exceed limits * NOTE: in general, it is not expected that the lock-zoom will be used in conjunction with this */ -- cgit v1.2.3