Commit d12bbbe1 authored by Anna Medonosová's avatar Anna Medonosová

Use plain color source instead of gradient in KisPresetLivePreviewView

Summary:
KisPresetLivePreviewView cannot display gradient color source: there is
no resource manager for KisResourcesSnapshot, therefore gradient is
nullptr. That crashes Krita, when it tries to render the preview.

This patch solves the issue by falling back to plain color source for
preset preview rendering.

BUG:385521

Reviewers: #krita, rempt

Reviewed By: #krita, rempt

Tags: #krita

Differential Revision: https://phabricator.kde.org/D19297
parent faeaa4c6
......@@ -236,6 +236,17 @@ void KisPresetLivePreviewView::setupAndPaintStroke()
settings->setProperty("brush_definition", d.toString());
}
}
// Preset preview cannot display gradient color source: there is
// no resource manager for KisResourcesSnapshot, therefore gradient is nullptr.
// BUG: 385521 (Selecting "Gradient" in brush editor crashes krita)
if (m_currentPreset->paintOp().id() == "paintbrush") {
QString colorSourceType = settings->getString("ColorSource/Type", "plain");
if (colorSourceType == "gradient") {
settings->setProperty("ColorSource/Type", "plain");
}
}
proxy_preset->setSettings(settings);
......
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