Commit 4fd8e7e5 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix crash in KisPaintOpBox when creating a new view with a tablet

slotInputDeviceChanged() comes much faster that the KisViewManager
manages to set up the previous paintop preset.

BUG:344862
parent ee6f7edf
......@@ -591,10 +591,12 @@ void KisPaintopBox::slotInputDeviceChanged(const KoInputDevice& inputDevice)
TabletToolMap::iterator toolData = m_tabletToolMap.find(inputDevice);
if (toolData == m_tabletToolMap.end()) {
KisPaintOpPresetSP preset =
if (m_resourceProvider->currentPreset()) {
KisPaintOpPresetSP preset =
m_resourceProvider->currentPreset()->clone();
m_resourceProvider->setPaintOpPreset(preset);
setCurrentPaintop(preset->paintOp(), preset);
m_resourceProvider->setPaintOpPreset(preset);
setCurrentPaintop(preset->paintOp(), preset);
}
} else {
setCurrentPaintop(toolData->paintOpID, toolData->preset);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment