projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b2e2a9
)
pv::view::View::zoom_fit: clamp the scale between MaxScale and MinScale
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Fri, 17 Jan 2014 18:48:08 +0000
(18:48 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Fri, 17 Jan 2014 18:51:15 +0000
(18:51 +0000)
Fixes #278
pv/view/view.cpp
patch
|
blob
|
history
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index cf990bcdced9f7cf44eeac9b149f2942cb8c2cc9..b0e97cb8e04e7df2d5ae558fe92ddcac0ed6c7f7 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-169,7
+169,8
@@
void View::zoom_fit()
if (w <= 0)
return;
- set_scale_offset(delta / w, extents.first);
+ const double scale = max(min(delta / w, MaxScale), MinScale);
+ set_scale_offset(scale, extents.first);
}
void View::zoom_one_to_one()