Commit 25dcc503 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix check after dynamic_cast

CID:249013
parent 9ed1170c
......@@ -301,20 +301,22 @@ QList<KisUniformPaintOpPropertySP> KisBrushBasedPaintOpSettings::uniformProperti
[](KisUniformPaintOpProperty *prop) {
KisBrushBasedPaintOpSettings *s =
dynamic_cast<KisBrushBasedPaintOpSettings*>(prop->settings().data());
const qreal value = s->autoSpacingActive() ?
s->autoSpacingCoeff() : s->spacing();
prop->setValue(value);
if (s) {
const qreal value = s->autoSpacingActive() ?
s->autoSpacingCoeff() : s->spacing();
prop->setValue(value);
}
});
prop->setWriteCallback(
[](KisUniformPaintOpProperty *prop) {
KisBrushBasedPaintOpSettings *s =
dynamic_cast<KisBrushBasedPaintOpSettings*>(prop->settings().data());
if (s->autoSpacingActive()) {
s->setAutoSpacing(true, prop->value().toReal());
} else {
s->setSpacing(prop->value().toReal());
if (s) {
if (s->autoSpacingActive()) {
s->setAutoSpacing(true, prop->value().toReal());
} else {
s->setSpacing(prop->value().toReal());
}
}
});
......
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