Don't layout StatusBar/redraw zoom field when playing animation

This commit is contained in:
David Capello 2021-06-08 20:19:29 -03:00
parent 3e3a7dbe27
commit ea468b7ed0
2 changed files with 10 additions and 4 deletions

View File

@ -941,8 +941,12 @@ void StatusBar::onActiveSiteChange(const Site& site)
showSnapToGridWarning(docPref.grid.snap());
// Current frame
m_currentFrame->setTextf(
"%d", site.frame()+docPref.timeline.firstFrame());
{
std::string newText =
fmt::format("{}", site.frame()+docPref.timeline.firstFrame());
if (m_currentFrame->text() != newText)
m_currentFrame->setText(newText);
}
// Zoom level
if (current_editor)
@ -952,7 +956,6 @@ void StatusBar::onActiveSiteChange(const Site& site)
m_docControls->setVisible(false);
showSnapToGridWarning(false);
}
layout();
}
void StatusBar::onPixelFormatChanged(DocEvent& ev)

View File

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2021 Igara Studio S.A.
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
@ -47,7 +48,9 @@ void ZoomEntry::setZoom(const render::Zoom& zoom)
if (m_locked)
return;
setText(onGetTextFromValue(zoom.linearScale()));
std::string newText = onGetTextFromValue(zoom.linearScale());
if (newText != text())
setText(newText);
}
void ZoomEntry::onValueChange()