summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-perspective_path.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-17 21:18:25 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-17 21:18:25 +0000
commit8e9f1ad900f718cbbf2d529bbd5606845902feaa (patch)
tree91a267fe03a4dc2c1bf56f5a3161c3a35e08e632 /src/live_effects/lpe-perspective_path.cpp
parentRunner up from 0.91 About Screen Contest for trunk until 0.92 (diff)
downloadinkscape-8e9f1ad900f718cbbf2d529bbd5606845902feaa.tar.gz
inkscape-8e9f1ad900f718cbbf2d529bbd5606845902feaa.zip
Fixes crash with perspective_lpe
(bzr r13725)
Diffstat (limited to 'src/live_effects/lpe-perspective_path.cpp')
-rw-r--r--src/live_effects/lpe-perspective_path.cpp40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp
index d43772cf7..5183a455f 100644
--- a/src/live_effects/lpe-perspective_path.cpp
+++ b/src/live_effects/lpe-perspective_path.cpp
@@ -44,6 +44,8 @@ public:
} // namespace PP
static Glib::ustring perspectiveID = _("First perspective");
+
+
LPEPerspectivePath::LPEPerspectivePath(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
// initialise your parameters here:
@@ -62,35 +64,41 @@ LPEPerspectivePath::LPEPerspectivePath(LivePathEffectObject *lpeobject) :
concatenate_before_pwd2 = true; // don't split the path into its subpaths
_provides_knotholder_entities = true;
- unapply = false;
- Persp3D *persp = persp3d_document_first_persp(lpeobject->document);
+}
+
+LPEPerspectivePath::~LPEPerspectivePath()
+{
+
+}
+void
+LPEPerspectivePath::doOnApply(SPLPEItem const* lpeitem)
+{
+ Persp3D *persp = persp3d_document_first_persp(lpeitem->document);
if(persp == 0 ){
char *msg = _("You need a BOX 3D object");
Gtk::MessageDialog dialog(msg, false, Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK, true);
dialog.run();
- unapply = true;
- return;
+ SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem);
+ item->removeCurrentPathEffect(false);
}
- Proj::TransfMat3x4 pmat = persp->perspective_impl->tmat;
- pmat = pmat * SP_ACTIVE_DESKTOP->doc2dt();
- pmat.copy_tmat(tmat);
-}
-
-LPEPerspectivePath::~LPEPerspectivePath()
-{
-
}
-
void
LPEPerspectivePath::doBeforeEffect (SPLPEItem const* lpeitem)
{
original_bbox(lpeitem, true);
- if(unapply){
- SP_LPE_ITEM(lpeitem)->removeCurrentPathEffect(false);
+ SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem);
+ Persp3D *persp = persp3d_document_first_persp(lpeitem->document);
+ if(persp == 0 ){
+ char *msg = _("You need a BOX 3D object");
+ Gtk::MessageDialog dialog(msg, false, Gtk::MESSAGE_INFO,
+ Gtk::BUTTONS_OK, true);
+ dialog.run();
return;
}
- SPLPEItem * item = const_cast<SPLPEItem*>(lpeitem);
+ Proj::TransfMat3x4 pmat = persp->perspective_impl->tmat;
+ pmat = pmat * SP_ACTIVE_DESKTOP->doc2dt();
+ pmat.copy_tmat(tmat);
item->apply_to_clippath(item);
item->apply_to_mask(item);
}