diff --git a/src/app/ui/zoom_entry.cpp b/src/app/ui/zoom_entry.cpp index d93af7fac..2fd5f48e2 100644 --- a/src/app/ui/zoom_entry.cpp +++ b/src/app/ui/zoom_entry.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2001-2015 David Capello +// Copyright (C) 2001-2016 David Capello // // This program is distributed under the terms of // the End-User License Agreement for Aseprite. @@ -32,6 +32,7 @@ using namespace ui; ZoomEntry::ZoomEntry() : IntEntry(0, render::Zoom::linearValues()-1, this) + , m_locked(false) { setSuffix("%"); setup_mini_look(this); @@ -41,11 +42,15 @@ ZoomEntry::ZoomEntry() void ZoomEntry::setZoom(const render::Zoom& zoom) { + if (m_locked) + return; + setText(onGetTextFromValue(zoom.linearScale())); } void ZoomEntry::onValueChange() { + base::ScopedValue lock(m_locked, true, m_locked); IntEntry::onValueChange(); render::Zoom zoom = render::Zoom::fromLinearScale(getValue()); diff --git a/src/app/ui/zoom_entry.h b/src/app/ui/zoom_entry.h index 5e6f57fa0..6004bb7cc 100644 --- a/src/app/ui/zoom_entry.h +++ b/src/app/ui/zoom_entry.h @@ -29,6 +29,8 @@ namespace app { int onGetValueFromText(const std::string& text) override; void onValueChange() override; + + bool m_locked; }; } // namespace app