Fix issue 367: Put alpha drawing mode isn't working

This commit is contained in:
David Capello 2014-03-08 20:37:43 -03:00
parent f107dd3cbc
commit d780e90784
2 changed files with 12 additions and 2 deletions

View File

@ -606,6 +606,10 @@ public:
m_inkType = (InkType)get_config_int(cfg_section.c_str(), "InkType", (int)kDefaultInk);
m_freehandAlgorithm = kDefaultFreehandAlgorithm;
// Reset invalid configurations for inks.
if (m_inkType != kDefaultInk && m_inkType != kPutAlphaInk)
m_inkType = kDefaultInk;
m_pen.enableSignals(false);
m_pen.setType((PenType)get_config_int(cfg_section.c_str(), "PenType", (int)PEN_TYPE_CIRCLE));
m_pen.setSize(get_config_int(cfg_section.c_str(), "PenSize", m_tool->getDefaultPenSize()));

View File

@ -289,10 +289,16 @@ protected:
void onChange() OVERRIDE {
ComboBox::onChange();
InkType inkType = kDefaultInk;
switch (getSelectedItemIndex()) {
case 0: inkType = kDefaultInk; break;
case 1: inkType = kPutAlphaInk; break;
}
ISettings* settings = UIContext::instance()->getSettings();
Tool* currentTool = settings->getCurrentTool();
settings->getToolSettings(currentTool)
->setInkType((InkType)getSelectedItemIndex());
settings->getToolSettings(currentTool)->setInkType(inkType);
}
void onCloseListBox() OVERRIDE {