diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-01-25 14:06:55 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-01-25 14:06:55 +0300 |
commit | 3b446ed4e45fccc0e4a6fc998a28442b5429a209 (patch) | |
tree | 78ceb1e316a4cd8bf2a24aaea64fa508db406563 /source/blender/editors/interface | |
parent | 7eb5504d79303efb2c9115db3aa033adeab2944c (diff) |
Durian Request/Bugfixes: Graph Editor Zooming doesn't go far enough
Pushed limits for Graph Editor view extents to proper limits, and fixed clamping used in View2D code which was preventing height of View2D viewports from getting below 1.0
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index c5e81e237c9..a6c37f689c5 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -25,6 +25,7 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include <float.h> #include <limits.h> #include <math.h> #include <string.h> @@ -347,11 +348,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) 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; + /* values used to divide, so make it safe + * NOTE: width and height must use FLT_MIN instead of 1, otherwise it is impossible to + * get enough resolution in Graph Editor for editing some curves + */ + if(width < FLT_MIN) width= 1; + if(height < FLT_MIN) height= 1; + if(winx < 1) winx= 1; + if(winy < 1) winy= 1; /* V2D_LIMITZOOM indicates that zoom level should be preserved when the window size changes */ if (resize && (v2d->keepzoom & V2D_KEEPZOOM)) { |