mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-16 06:40:17 +00:00
Don't modify zoom indicator from Editor when the user is modifying it
Related to #779
This commit is contained in:
parent
a46a087c51
commit
da51c5ba7c
@ -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<bool> lock(m_locked, true, m_locked);
|
||||
IntEntry::onValueChange();
|
||||
|
||||
render::Zoom zoom = render::Zoom::fromLinearScale(getValue());
|
||||
|
@ -29,6 +29,8 @@ namespace app {
|
||||
int onGetValueFromText(const std::string& text) override;
|
||||
|
||||
void onValueChange() override;
|
||||
|
||||
bool m_locked;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
Loading…
x
Reference in New Issue
Block a user