Do not center editor scroll by default when we zoom with keys or zoom tool

This commit is contained in:
David Capello 2014-11-07 19:11:23 -03:00
parent 6a1809b814
commit cd913f7619
3 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,7 @@
</hbox>
<check text="Show timeline automatically" id="autotimeline" tooltip="Show the timeline automatically&#10;when a new frame or layer is added." />
<check text="Expand menu bar items on mouseover" id="expand_menubar_on_mouseover" tooltip="Check this option to get&#10;this old menus behavior." />
<check text="Center editor when zoom with keys or zoom tool" id="center_on_zoom" />
<separator horizontal="true" />
<link id="locate_file" text="Locate Configuration File" />
<link id="locate_crash_folder" text="Locate Crash Folder" />

View File

@ -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<RightClickMode>(rightClickBehavior()->getSelectedItemIndex()));

View File

@ -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;