Restore brush pattern correctly from user preferences

This commit is contained in:
Gaspar Capello 2019-04-22 14:51:11 -03:00 committed by David Capello
parent a2d9f3fc76
commit 6f72666330

View File

@ -271,10 +271,17 @@ private:
class ContextBar::BrushPatternField : public ComboBox {
public:
BrushPatternField() : m_lock(false) {
BrushPatternField() {
// We use "m_lock" variable to avoid setting the pattern
// brush when we call ComboBox::addItem() (because the first
// addItem() generates an onChange() event).
m_lock = true;
addItem("Pattern aligned to source");
addItem("Pattern aligned to destination");
addItem("Paint brush");
m_lock = false;
setSelectedItemIndex((int)Preferences::instance().brush.pattern());
}
void setBrushPattern(BrushPattern type) {