From fedf818cda05d6089af968bd6540a022803f2f64 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 20 Apr 2015 16:57:24 -0300 Subject: [PATCH] Support more percentages as parameter in ZoomCommand (related to #633) In this way we could have a command to set zoom to 50% --- src/app/commands/cmd_zoom.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/app/commands/cmd_zoom.cpp b/src/app/commands/cmd_zoom.cpp index 9ebd20088..9ef7db102 100644 --- a/src/app/commands/cmd_zoom.cpp +++ b/src/app/commands/cmd_zoom.cpp @@ -74,14 +74,7 @@ void ZoomCommand::onExecute(Context* context) zoom.out(); break; case Set: - switch (m_percentage) { - case 3200: zoom = render::Zoom(32, 1); break; - case 1600: zoom = render::Zoom(16, 1); break; - case 800: zoom = render::Zoom(8, 1); break; - case 400: zoom = render::Zoom(4, 1); break; - case 200: zoom = render::Zoom(2, 1); break; - default: zoom = render::Zoom(1, 1); break; - } + zoom = render::Zoom::fromScale(double(m_percentage) / 100.0); break; }