summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-14 19:14:04 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-14 19:14:04 +0000
commit840daf70ff3f7c2c8e9cc0fae0037befcfa18edf (patch)
treec63e553bdacc5600983a30c11ab7bd7a31584ff1
parentAdd inverse subdivision chamfer to fillet chamfer LPE, feature sugested by Iv... (diff)
downloadinkscape-840daf70ff3f7c2c8e9cc0fae0037befcfa18edf.tar.gz
inkscape-840daf70ff3f7c2c8e9cc0fae0037befcfa18edf.zip
fix a crash bug applyed on groups
(bzr r13708.1.1)
-rw-r--r--src/live_effects/effect.cpp3
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp11
-rw-r--r--src/live_effects/lpe-copy_rotate.h3
3 files changed, 11 insertions, 6 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index e49a15dd0..0f4bdfaaa 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -112,7 +112,6 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{PATH_LENGTH, N_("Path length"), "path_length"},
{PERP_BISECTOR, N_("Perpendicular bisector"), "perp_bisector"},
{PERSPECTIVE_PATH, N_("Perspective path"), "perspective_path"},
- {COPY_ROTATE, N_("Rotate copies"), "copy_rotate"},
{RECURSIVE_SKELETON, N_("Recursive skeleton"), "recursive_skeleton"},
{TANGENT_TO_CURVE, N_("Tangent to curve"), "tangent_to_curve"},
{TEXT_LABEL, N_("Text label"), "text_label"},
@@ -153,6 +152,8 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{PERSPECTIVE_ENVELOPE, N_("Perspective/Envelope"), "perspective-envelope"},
{FILLET_CHAMFER, N_("Fillet/Chamfer"), "fillet-chamfer"},
{INTERPOLATE_POINTS, N_("Interpolate points"), "interpolate_points"},
+/* 0.92 */
+ {COPY_ROTATE, N_("Rotate copies"), "copy_rotate"},
};
const Util::EnumDataConverter<EffectType> LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData));
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index e466093d3..7e3f35f9d 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -76,11 +76,12 @@ LPECopyRotate::~LPECopyRotate()
void
LPECopyRotate::doOnApply(SPLPEItem const* lpeitem)
{
- SPCurve const *curve = SP_SHAPE(lpeitem)->_curve;
+ using namespace Geom;
- A = *(curve->first_point());
- B = *(curve->last_point());
+ original_bbox(lpeitem);
+ Point A(boundingbox_X.min(), boundingbox_Y.middle());
+ Point B(boundingbox_X.max(), boundingbox_Y.middle());
origin.param_setValue(A);
dir = unit_vector(B - A);
@@ -123,12 +124,14 @@ LPECopyRotate::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geo
Path path(start_pos);
path.appendNew<LineSegment>((Geom::Point) origin);
path.appendNew<LineSegment>(rot_pos);
-
+ std::cout << rot_pos << "rot\n";
+ std::cout << origin << "origin\n";
PathVector pathv;
pathv.push_back(path);
hp_vec.push_back(pathv);
}
+
void LPECopyRotate::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
{
KnotHolderEntity *e = new CR::KnotHolderEntityStartingAngle(this);
diff --git a/src/live_effects/lpe-copy_rotate.h b/src/live_effects/lpe-copy_rotate.h
index ca7aa269c..c84889f57 100644
--- a/src/live_effects/lpe-copy_rotate.h
+++ b/src/live_effects/lpe-copy_rotate.h
@@ -16,6 +16,7 @@
#include "live_effects/effect.h"
#include "live_effects/parameter/point.h"
+#include "live_effects/lpegroupbbox.h"
namespace Inkscape {
namespace LivePathEffect {
@@ -26,7 +27,7 @@ namespace CR {
class KnotHolderEntityRotationAngle;
}
-class LPECopyRotate : public Effect {
+class LPECopyRotate : public Effect, GroupBBoxEffect {
public:
LPECopyRotate(LivePathEffectObject *lpeobject);
virtual ~LPECopyRotate();