summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
committerDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
commitaeb9c1bde66de096910757abb17dedb94ad74207 (patch)
treec0adf97685b0fa8af1553b14d20601f280492762 /src/live_effects
parentFixed some math, so that the objects now line up correctly (diff)
parentAdding checks to prevent null pointer dereferences (diff)
downloadinkscape-aeb9c1bde66de096910757abb17dedb94ad74207.tar.gz
inkscape-aeb9c1bde66de096910757abb17dedb94ad74207.zip
Trunk merge
(bzr r11073.1.29)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/lpe-angle_bisector.cpp10
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp13
-rw-r--r--src/live_effects/lpe-knot.cpp15
-rw-r--r--src/live_effects/lpe-parallel.cpp13
-rw-r--r--src/live_effects/lpe-perp_bisector.cpp10
-rw-r--r--src/live_effects/lpe-perspective_path.cpp14
-rw-r--r--src/live_effects/lpe-powerstroke.cpp9
-rw-r--r--src/live_effects/lpe-tangent_to_curve.cpp15
-rw-r--r--src/live_effects/parameter/point.cpp2
-rw-r--r--src/live_effects/parameter/powerstrokepointarray.cpp13
-rw-r--r--src/live_effects/parameter/vector.cpp4
11 files changed, 53 insertions, 65 deletions
diff --git a/src/live_effects/lpe-angle_bisector.cpp b/src/live_effects/lpe-angle_bisector.cpp
index 99110c51e..b337f71d8 100644
--- a/src/live_effects/lpe-angle_bisector.cpp
+++ b/src/live_effects/lpe-angle_bisector.cpp
@@ -83,16 +83,14 @@ void
LPEAngleBisector::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
{
KnotHolderEntity *e = new AB::KnotHolderEntityLeftEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the \"left\" end of the bisector")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the \"left\" end of the bisector") );
knotholder->add(e);
}
{
KnotHolderEntity *e = new AB::KnotHolderEntityRightEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the \"right\" of the bisector")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the \"right\" of the bisector") );
knotholder->add(e);
}
};
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index c61f4c3c1..bddd65be6 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -127,20 +127,17 @@ LPECopyRotate::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector<Geom::Pat
hp_vec.push_back(pathv);
}
-void
-LPECopyRotate::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
+void LPECopyRotate::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
{
KnotHolderEntity *e = new CR::KnotHolderEntityStartingAngle(this);
- e->create( desktop, item, knotholder,
- _("Adjust the starting angle")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the starting angle") );
knotholder->add(e);
}
{
KnotHolderEntity *e = new CR::KnotHolderEntityRotationAngle(this);
- e->create( desktop, item, knotholder,
- _("Adjust the rotation angle")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the rotation angle") );
knotholder->add(e);
}
};
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index 7ec103a85..3a9b036d8 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -607,15 +607,12 @@ LPEKnot::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector<Geom::PathVecto
hp_vec.push_back(pathv);
}
-void
-LPEKnot::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
- {
- KnotHolderEntity *e = new KnotHolderEntityCrossingSwitcher(this);
- e->create( desktop, item, knotholder,
- _("Drag to select a crossing, click to flip it")
- /*optional: knot_shape, knot_mode, knot_color*/);
- knotholder->add(e);
- }
+void LPEKnot::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item)
+{
+ KnotHolderEntity *e = new KnotHolderEntityCrossingSwitcher(this);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Drag to select a crossing, click to flip it") );
+ knotholder->add(e);
};
diff --git a/src/live_effects/lpe-parallel.cpp b/src/live_effects/lpe-parallel.cpp
index 4d15bf13e..95340fcf4 100644
--- a/src/live_effects/lpe-parallel.cpp
+++ b/src/live_effects/lpe-parallel.cpp
@@ -94,20 +94,17 @@ LPEParallel::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd
return output + dir;
}
-void
-LPEParallel::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
+void LPEParallel::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
{
KnotHolderEntity *e = new Pl::KnotHolderEntityLeftEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the \"left\" end of the parallel")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the \"left\" end of the parallel") );
knotholder->add(e);
}
{
KnotHolderEntity *e = new Pl::KnotHolderEntityRightEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the \"right\" end of the parallel")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the \"right\" end of the parallel") );
knotholder->add(e);
}
};
diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp
index ddf16cc9a..f6d69f03c 100644
--- a/src/live_effects/lpe-perp_bisector.cpp
+++ b/src/live_effects/lpe-perp_bisector.cpp
@@ -154,16 +154,14 @@ void
LPEPerpBisector::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
{
KnotHolderEntity *e = new PB::KnotHolderEntityLeftEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the bisector's \"left\" end")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the bisector's \"left\" end") );
knotholder->add(e);
}
{
KnotHolderEntity *e = new PB::KnotHolderEntityRightEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the bisector's \"right\" end")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the bisector's \"right\" end") );
knotholder->add(e);
}
};
diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp
index d9df32076..c8048f74b 100644
--- a/src/live_effects/lpe-perspective_path.cpp
+++ b/src/live_effects/lpe-perspective_path.cpp
@@ -137,15 +137,11 @@ LPEPerspectivePath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > cons
return output;
}
-void
-LPEPerspectivePath::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
- {
- KnotHolderEntity *e = new PP::KnotHolderEntityOffset(this);
- e->create( desktop, item, knotholder,
- _("Adjust the origin")
- /*optional: knot_shape, knot_mode, knot_color*/);
- knotholder->add(e);
- }
+void LPEPerspectivePath::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
+ KnotHolderEntity *e = new PP::KnotHolderEntityOffset(this);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the origin") );
+ knotholder->add(e);
};
namespace PP {
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp
index 44f9b9eb0..048742452 100644
--- a/src/live_effects/lpe-powerstroke.cpp
+++ b/src/live_effects/lpe-powerstroke.cpp
@@ -269,6 +269,15 @@ Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise<Geom::D2<Geom::SBasis>
break;
}
+ // check if ellipse.ray is within 'sane' range.
+ if ( ( fabs(ellipse.ray(Geom::X)) > 1e6 ) ||
+ ( fabs(ellipse.ray(Geom::Y)) > 1e6 ) )
+ {
+ // do bevel, and break
+ pb.lineTo(B[i].at0());
+ break;
+ }
+
pb.arcTo( ellipse.ray(Geom::X), ellipse.ray(Geom::Y), ellipse.rot_angle(),
false, width < 0, B[i].at0() );
diff --git a/src/live_effects/lpe-tangent_to_curve.cpp b/src/live_effects/lpe-tangent_to_curve.cpp
index 04cc3335f..633a36860 100644
--- a/src/live_effects/lpe-tangent_to_curve.cpp
+++ b/src/live_effects/lpe-tangent_to_curve.cpp
@@ -100,23 +100,20 @@ void
LPETangentToCurve::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
{
KnotHolderEntity *e = new TtC::KnotHolderEntityAttachPt(this);
- e->create( desktop, item, knotholder,
- _("Adjust the point of attachment of the tangent")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the point of attachment of the tangent") );
knotholder->add(e);
}
{
KnotHolderEntity *e = new TtC::KnotHolderEntityLeftEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the \"left\" end of the tangent")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the \"left\" end of the tangent") );
knotholder->add(e);
}
{
KnotHolderEntity *e = new TtC::KnotHolderEntityRightEnd(this);
- e->create( desktop, item, knotholder,
- _("Adjust the \"right\" end of the tangent")
- /*optional: knot_shape, knot_mode, knot_color*/);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the \"right\" end of the tangent") );
knotholder->add(e);
}
};
diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp
index eb2543ac7..c192cd6d6 100644
--- a/src/live_effects/parameter/point.cpp
+++ b/src/live_effects/parameter/point.cpp
@@ -165,7 +165,7 @@ PointParam::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SP
{
PointParamKnotHolderEntity *e = new PointParamKnotHolderEntity(this);
// TODO: can we ditch handleTip() etc. because we have access to handle_tip etc. itself???
- e->create(desktop, item, knotholder, handleTip(), knot_shape, knot_mode, knot_color);
+ e->create(desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, handleTip(), knot_shape, knot_mode, knot_color);
knotholder->add(e);
}
diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp
index 06048cb32..07cc71245 100644
--- a/src/live_effects/parameter/powerstrokepointarray.cpp
+++ b/src/live_effects/parameter/powerstrokepointarray.cpp
@@ -222,22 +222,21 @@ PowerStrokePointArrayParamKnotHolderEntity::knot_click(guint state)
};
// add knot to knotholder
PowerStrokePointArrayParamKnotHolderEntity *e = new PowerStrokePointArrayParamKnotHolderEntity(_pparam, _index+1);
- e->create( this->desktop, this->item, parent_holder,
- _("<b>Stroke width control point</b>: drag to alter the stroke width. <b>Ctrl+click</b> adds a control point, <b>Ctrl+Alt+click</b> deletes it."),
+ e->create( this->desktop, this->item, parent_holder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("<b>Stroke width control point</b>: drag to alter the stroke width. <b>Ctrl+click</b> adds a control point, <b>Ctrl+Alt+click</b> deletes it."),
_pparam->knot_shape, _pparam->knot_mode, _pparam->knot_color);
parent_holder->add(e);
}
}
}
-void
-PowerStrokePointArrayParam::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item)
+void PowerStrokePointArrayParam::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item)
{
for (unsigned int i = 0; i < _vector.size(); ++i) {
PowerStrokePointArrayParamKnotHolderEntity *e = new PowerStrokePointArrayParamKnotHolderEntity(this, i);
- e->create( desktop, item, knotholder,
- _("<b>Stroke width control point</b>: drag to alter the stroke width. <b>Ctrl+click</b> adds a control point, <b>Ctrl+Alt+click</b> deletes it."),
- knot_shape, knot_mode, knot_color);
+ e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("<b>Stroke width control point</b>: drag to alter the stroke width. <b>Ctrl+click</b> adds a control point, <b>Ctrl+Alt+click</b> deletes it."),
+ knot_shape, knot_mode, knot_color);
knotholder->add(e);
}
}
diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp
index 3e0ac9092..3348670dd 100644
--- a/src/live_effects/parameter/vector.cpp
+++ b/src/live_effects/parameter/vector.cpp
@@ -191,11 +191,11 @@ void
VectorParam::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item)
{
VectorParamKnotHolderEntity_Origin *origin_e = new VectorParamKnotHolderEntity_Origin(this);
- origin_e->create(desktop, item, knotholder, handleTip(), ori_knot_shape, ori_knot_mode, ori_knot_color);
+ origin_e->create(desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, handleTip(), ori_knot_shape, ori_knot_mode, ori_knot_color);
knotholder->add(origin_e);
VectorParamKnotHolderEntity_Vector *vector_e = new VectorParamKnotHolderEntity_Vector(this);
- vector_e->create(desktop, item, knotholder, handleTip(), vec_knot_shape, vec_knot_mode, vec_knot_color);
+ vector_e->create(desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, handleTip(), vec_knot_shape, vec_knot_mode, vec_knot_color);
knotholder->add(vector_e);
}