Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/widgets/kis_preset_live_preview_view.cpp
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Line(s) | 209 | if (!brushDefinition.isEmpty()) { | |||
---|---|---|---|---|---|
231 | brush->setScale(scale); | 231 | brush->setScale(scale); | ||
232 | d.clear(); | 232 | d.clear(); | ||
233 | element = d.createElement("Brush"); | 233 | element = d.createElement("Brush"); | ||
234 | brush->toXML(d, element); | 234 | brush->toXML(d, element); | ||
235 | d.appendChild(element); | 235 | d.appendChild(element); | ||
236 | settings->setProperty("brush_definition", d.toString()); | 236 | settings->setProperty("brush_definition", d.toString()); | ||
237 | } | 237 | } | ||
238 | } | 238 | } | ||
239 | | ||||
240 | // Preset preview cannot display gradient color source: there is | ||||
241 | // no resource manager for KisResourcesSnapshot, therefore gradient is nullptr. | ||||
242 | // BUG: 385521 (Selecting "Gradient" in brush editor crashes krita) | ||||
243 | if (m_currentPreset->paintOp().id() == "paintbrush") { | ||||
244 | QString colorSourceType = settings->getString("ColorSource/Type", "plain"); | ||||
245 | if (colorSourceType == "gradient") { | ||||
246 | settings->setProperty("ColorSource/Type", "plain"); | ||||
247 | } | ||||
248 | } | ||||
249 | | ||||
239 | proxy_preset->setSettings(settings); | 250 | proxy_preset->setSettings(settings); | ||
240 | 251 | | |||
241 | 252 | | |||
242 | KisResourcesSnapshotSP resources = | 253 | KisResourcesSnapshotSP resources = | ||
243 | new KisResourcesSnapshot(m_image, | 254 | new KisResourcesSnapshot(m_image, | ||
244 | m_layer); | 255 | m_layer); | ||
245 | 256 | | |||
246 | resources->setBrush(proxy_preset); | 257 | resources->setBrush(proxy_preset); | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |