diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-16 19:51:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-16 19:55:30 +0300 |
commit | 5a13f8a750c7e9b20157fc5e3b4a518eaa295ef9 (patch) | |
tree | 1ddcc5a647c00e4b1d8d487f28d40cd6b9489e3f /source/blender/blenkernel/intern/colortools.c | |
parent | cb4e3587353c0f477feef459e12ff14872143c9c (diff) |
UI: Curve clipping didn't enforce zoom.
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index acfec306997..7a3cc118eb5 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -725,6 +725,16 @@ void curvemapping_changed(CurveMapping *cumap, const bool rem_doubles) cmp[a].y -= dy; } } + + /* ensure zoom-level respects clipping */ + if (BLI_rctf_size_x(&cumap->curr) > BLI_rctf_size_x(&cumap->clipr)) { + cumap->curr.xmin = cumap->clipr.xmin; + cumap->curr.xmax = cumap->clipr.xmax; + } + if (BLI_rctf_size_y(&cumap->curr) > BLI_rctf_size_y(&cumap->clipr)) { + cumap->curr.ymin = cumap->clipr.ymin; + cumap->curr.ymax = cumap->clipr.ymax; + } } |