summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6656f19)
raw | patch | inline | side by side (parent: 6656f19)
author | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 4 Jun 2008 13:14:45 +0000 (13:14 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 4 Jun 2008 13:14:45 +0000 (13:14 +0000) |
src/draw-context.cpp | patch | blob | history | |
src/draw-context.h | patch | blob | history |
diff --git a/src/draw-context.cpp b/src/draw-context.cpp
index 9a2c1215c0f3bf2692dccd970db816e3fcc28a07..0130f2378a6b2f5409dae49dcfe073860bba623d 100644 (file)
--- a/src/draw-context.cpp
+++ b/src/draw-context.cpp
dc->green_color = 0x00ff007f;
dc->red_curve_is_valid = false;
+ dc->waiting_LPE = Inkscape::LivePathEffect::INVALID_LPE;
+
new (&dc->sel_changed_connection) sigc::connection();
new (&dc->sel_modified_connection) sigc::connection();
}
return ret;
}
+/*
+ * If we have an item and a waiting LPE, apply the effect to the item
+ */
+void
+spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item)
+{
+ if (item && dc->waiting_LPE != Inkscape::LivePathEffect::INVALID_LPE) {
+ Inkscape::LivePathEffect::Effect::createAndApply(dc->waiting_LPE, dc->desktop->doc(), item);
+ }
+}
/*
* Selection handlers
static void
spdc_selection_changed(Inkscape::Selection *sel, SPDrawContext *dc)
{
+ spdc_check_for_and_apply_waiting_LPE(dc, sel->singleItem());
+
if (dc->attach) {
spdc_attach_selection(dc, sel);
}
diff --git a/src/draw-context.h b/src/draw-context.h
index 5ac1a7d0978fe42a2d89eef2a563d4765f524dec..c1166dcbd0fed2b516f6891365bf284dc24c0c19 100644 (file)
--- a/src/draw-context.h
+++ b/src/draw-context.h
#include <forward.h>
#include <display/display-forward.h>
#include <libnr/nr-point.h>
+#include "live_effects/effect.h"
/* Freehand context */
/* End anchor */
SPDrawAnchor *ea;
+ /* type of the LPE that is to be applied automatically to a finished path (if any) */
+ Inkscape::LivePathEffect::EffectType waiting_LPE;
+
sigc::connection sel_changed_connection;
sigc::connection sel_modified_connection;
void spdc_concat_colors_and_flush(SPDrawContext *dc, gboolean forceclosed);
void spdc_endpoint_snap_rotation(SPEventContext const *const ec, NR::Point &p, NR::Point const o, guint state);
void spdc_endpoint_snap_free(SPEventContext const *ec, NR::Point &p, guint state);
-
+void spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item);
#endif