1
0
mirror of https://github.com/aseprite/aseprite.git synced 2025-03-24 16:43:34 +00:00

Don't update brush size/angle fields when we're editing them

This commit is contained in:
David Capello 2016-12-02 17:24:09 -03:00
parent da51c5ba7c
commit dcb27c38d7

@ -1547,7 +1547,8 @@ void ContextBar::updateForTool(tools::Tool* tool)
// target to implement this new IContextBarUser and ask for
// ContextBar elements.
base::ScopedValue<bool> lockFlag(g_updatingFromCode, true, g_updatingFromCode);
const bool oldUpdatingFromCode = g_updatingFromCode;
base::ScopedValue<bool> lockFlag(g_updatingFromCode, true, oldUpdatingFromCode);
ToolPreferences* toolPref = nullptr;
ToolPreferences::Brush* brushPref = nullptr;
@ -1569,8 +1570,10 @@ void ContextBar::updateForTool(tools::Tool* tool)
m_brushType->updateBrush(tool);
if (brushPref) {
m_brushSize->setTextf("%d", brushPref->size());
m_brushAngle->setTextf("%d", brushPref->angle());
if (!oldUpdatingFromCode) {
m_brushSize->setTextf("%d", brushPref->size());
m_brushAngle->setTextf("%d", brushPref->angle());
}
}
m_brushPatternField->setBrushPattern(