[aseprite] 171/308: Reduce code in StateWithWheelBehavior::onMouseWheel()
Tobias Hansen
thansen at moszumanska.debian.org
Tue Mar 8 02:45:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 5b38caed00058ec3de7952b6ed806644f3a1674f
Author: David Capello <davidcapello at gmail.com>
Date: Wed Dec 30 10:29:13 2015 -0300
Reduce code in StateWithWheelBehavior::onMouseWheel()
---
src/app/ui/editor/state_with_wheel_behavior.cpp | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/app/ui/editor/state_with_wheel_behavior.cpp b/src/app/ui/editor/state_with_wheel_behavior.cpp
index 030aa59..4627c8a 100644
--- a/src/app/ui/editor/state_with_wheel_behavior.cpp
+++ b/src/app/ui/editor/state_with_wheel_behavior.cpp
@@ -20,6 +20,7 @@
#include "app/ui_context.h"
#include "doc/palette.h"
#include "ui/message.h"
+#include "ui/theme.h"
namespace app {
@@ -111,14 +112,8 @@ bool StateWithWheelBehavior::onMouseWheel(Editor* editor, MouseMessage* msg)
case WHEEL_ZOOM: {
MouseMessage* mouseMsg = static_cast<MouseMessage*>(msg);
render::Zoom zoom = editor->zoom();
- if (dz < 0) {
- while (dz++ < 0)
- zoom.in();
- }
- else {
- while (dz-- > 0)
- zoom.out();
- }
+
+ zoom = render::Zoom::fromLinearScale(zoom.linearScale() - dz);
if (editor->zoom() != zoom) {
bool center = Preferences::instance().editor.zoomFromCenterWithWheel();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list