diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2011-04-01 22:59:01 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2011-04-01 22:59:01 +0000 |
| commit | d6978fcea4a2ccd2d9cccefabc6558a74f332a6d (patch) | |
| tree | 98ea2cff482d6b2196e4bffa4fab3a7a4d5aead0 /src/sp-shape.cpp | |
| parent | German translation update. (diff) | |
| download | inkscape-d6978fcea4a2ccd2d9cccefabc6558a74f332a6d.tar.gz inkscape-d6978fcea4a2ccd2d9cccefabc6558a74f332a6d.zip | |
add curve before LPE to SPShape. this is useful for helperpath display. It was inspired from fixing bug 407008
Fixed bugs:
- https://launchpad.net/bugs/407008
(bzr r10142)
Diffstat (limited to 'src/sp-shape.cpp')
| -rw-r--r-- | src/sp-shape.cpp | 36 |
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) |
