summaryrefslogtreecommitdiffstats
path: root/src/sp-shape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp-shape.cpp')
-rw-r--r--src/sp-shape.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index e9b0909ed..72559c63f 100644
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
@@ -126,6 +126,7 @@ void SPShape::sp_shape_init(SPShape *shape)
shape->marker[i] = NULL;
}
shape->curve = NULL;
+ shape->curve_before_lpe = NULL;
}
void SPShape::sp_shape_finalize(GObject *object)
@@ -195,6 +196,9 @@ void SPShape::sp_shape_release(SPObject *object)
if (shape->curve) {
shape->curve = shape->curve->unref();
}
+ if (shape->curve_before_lpe) {
+ shape->curve_before_lpe = shape->curve_before_lpe->unref();
+ }
if (((SPObjectClass *) SPShapeClass::parent_class)->release) {
((SPObjectClass *) SPShapeClass::parent_class)->release (object);
@@ -1115,6 +1119,20 @@ void SPShape::setCurve(SPCurve *curve, unsigned int owner)
}
/**
+ * Sets curve_before_lpe to refer to the curve.
+ */
+void
+SPShape::setCurveBeforeLPE (SPCurve *curve)
+{
+ if (this->curve_before_lpe) {
+ this->curve_before_lpe = this->curve_before_lpe->unref();
+ }
+ if (curve) {
+ this->curve_before_lpe = curve->ref();
+ }
+}
+
+/**
* Return duplicate of curve (if any exists) or NULL if there is no curve
*/
SPCurve * SPShape::getCurve()
@@ -1126,6 +1144,24 @@ SPCurve * SPShape::getCurve()
}
/**
+ * Return duplicate of curve *before* LPE (if any exists) or NULL if there is no curve
+ */
+SPCurve *
+SPShape::getCurveBeforeLPE()
+{
+ if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(this))) {
+ if (this->curve_before_lpe) {
+ return this->curve_before_lpe->copy();
+ }
+ } else {
+ if (this->curve) {
+ return this->curve->copy();
+ }
+ }
+ return NULL;
+}
+
+/**
* Same as sp_shape_set_curve but without updating the display
*/
void SPShape::setCurveInsync(SPCurve *curve, unsigned int owner)