summaryrefslogtreecommitdiffstats
path: root/src/object/sp-star.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-04-23 21:34:58 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-04-23 21:37:56 +0000
commite254e5c6ced93403c125592237b43215bde7b0ff (patch)
tree765903f16cd02454f1c63f421e0ce2f299dacc55 /src/object/sp-star.cpp
parentFix warings on updates (diff)
downloadinkscape-e254e5c6ced93403c125592237b43215bde7b0ff.tar.gz
inkscape-e254e5c6ced93403c125592237b43215bde7b0ff.zip
Fixing LPE recalculations warnings on update
Diffstat (limited to 'src/object/sp-star.cpp')
-rw-r--r--src/object/sp-star.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/object/sp-star.cpp b/src/object/sp-star.cpp
index 1be7651f8..da00080a3 100644
--- a/src/object/sp-star.cpp
+++ b/src/object/sp-star.cpp
@@ -82,11 +82,13 @@ Inkscape::XML::Node* SPStar::write(Inkscape::XML::Document *xml_doc, Inkscape::X
}
this->set_shape();
-
- char *d = sp_svg_write_path (this->_curve->get_pathvector());
- repr->setAttribute("d", d);
- g_free(d);
-
+ if (this->_curve) {
+ char *d = sp_svg_write_path (this->_curve->get_pathvector());
+ repr->setAttribute("d", d);
+ g_free(d);
+ } else {
+ repr->setAttribute("d", NULL);
+ }
// CPPIFY: see header file
SPShape::write(xml_doc, repr, flags);
@@ -432,7 +434,12 @@ void SPStar::set_shape() {
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
SPCurve * before = this->getCurveBeforeLPE();
if (before || this->hasPathEffectRecursive()) {
- this->setCurveBeforeLPE(c);
+ if (c && before && before->get_pathvector() != c->get_pathvector()){
+ this->setCurveBeforeLPE(c);
+ sp_lpe_item_update_patheffect(this, true, false);
+ } else {
+ this->setCurveBeforeLPE(c);
+ }
} else {
this->setCurveInsync(c);
}
@@ -484,6 +491,17 @@ void SPStar::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::
Geom::Affine SPStar::set_transform(Geom::Affine const &xform)
{
bool opt_trans = (randomized == 0);
+ if (hasPathEffect() && pathEffectsEnabled() &&
+ (this->hasPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL) ||
+ this->hasPathEffectOfType(Inkscape::LivePathEffect::BEND_PATH) ||
+ this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_MANY) ||
+ this->hasPathEffectOfType(Inkscape::LivePathEffect::FILL_BETWEEN_STROKES) ) )
+ {
+ // if path has this LPE applied, don't write the transform to the pathdata, but write it 'unoptimized'
+ // also if the effect is type BEND PATH to fix bug #179842
+ this->adjust_livepatheffect(xform);
+ return xform;
+ }
// Only set transform with proportional scaling
if (!xform.withoutTranslation().isUniformScale()) {
// Adjust livepatheffect