From cd913f76199cfc76dd836f28d29ad40e3b8b152a Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 7 Nov 2014 19:11:23 -0300 Subject: [PATCH] Do not center editor scroll by default when we zoom with keys or zoom tool --- data/widgets/options.xml | 1 + src/app/commands/cmd_options.cpp | 5 +++++ src/app/ui/editor/editor.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data/widgets/options.xml b/data/widgets/options.xml index c26a9c3dc..520610ec5 100644 --- a/data/widgets/options.xml +++ b/data/widgets/options.xml @@ -23,6 +23,7 @@ + diff --git a/src/app/commands/cmd_options.cpp b/src/app/commands/cmd_options.cpp index bc65156bb..2231beb8b 100644 --- a/src/app/commands/cmd_options.cpp +++ b/src/app/commands/cmd_options.cpp @@ -78,6 +78,9 @@ public: ui::MenuBar::expandOnMouseover())) expandMenubarOnMouseover()->setSelected(true); + if (get_config_bool("Editor", "CenterOnZoom", false)) + centerOnZoom()->setSelected(true); + if (m_settings->experimental()->useNativeCursor()) nativeCursor()->setSelected(true); @@ -154,6 +157,8 @@ public: set_config_bool("Options", "ExpandMenuBarOnMouseover", expandOnMouseover); ui::MenuBar::setExpandOnMouseover(expandOnMouseover); + set_config_bool("Editor", "CenterOnZoom", centerOnZoom()->isSelected()); + m_settings->setShowSpriteEditorScrollbars(showScrollbars()->isSelected()); m_settings->setZoomWithScrollWheel(wheelZoom()->isSelected()); m_settings->setRightClickMode(static_cast(rightClickBehavior()->getSelectedItemIndex())); diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index e49b09f76..f1be12a63 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -1305,7 +1305,7 @@ void Editor::setZoomAndCenterInMouse(int zoom, int mouse_x, int mouse_y, ZoomBeh switch (zoomBehavior) { case kCofiguredZoomBehavior: - centerMouse = get_config_bool("Editor", "CenterMouseInZoom", true); + centerMouse = get_config_bool("Editor", "CenterOnZoom", false); break; case kCenterOnZoom: centerMouse = true;