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:
authorTon Roosendaal <ton@blender.org>2009-06-27 20:35:42 +0400
committerTon Roosendaal <ton@blender.org>2009-06-27 20:35:42 +0400
commitc79e57dba8f436e0b3a9b231f70a2ba121438907 (patch)
treebc8ee726a6d2f0d7d1026c46d631d1b7111abfdc /source/blender/editors/interface/view2d.c
parent7b547f7ce7351548a5dd4518ae1fc1ad9a726cbd (diff)
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
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c6
1 files changed, 6 insertions, 0 deletions
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
*/