summaryrefslogtreecommitdiffstats
path: root/src/draw-context.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-06-12 13:23:30 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-06-12 13:23:30 +0000
commit30dd228b3490bc81b04c6fa3fb36f8c91ceec4e6 (patch)
treecbf33c264f6e4a6e048508046ae011a7dd237d7f /src/draw-context.cpp
parentInfrastructure in class LivePathEffect::Effect to put Inkscape into 'wait for... (diff)
downloadinkscape-30dd228b3490bc81b04c6fa3fb36f8c91ceec4e6.tar.gz
inkscape-30dd228b3490bc81b04c6fa3fb36f8c91ceec4e6.zip
More infrastructure to have waiting LPEs that are freshly created and applied to yet-to-be-drawn paths
(bzr r5903)
Diffstat (limited to 'src/draw-context.cpp')
-rw-r--r--src/draw-context.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/draw-context.cpp b/src/draw-context.cpp
index 4d60cda05..de030c7d5 100644
--- a/src/draw-context.cpp
+++ b/src/draw-context.cpp
@@ -115,7 +115,7 @@ sp_draw_context_init(SPDrawContext *dc)
dc->green_color = 0x00ff007f;
dc->red_curve_is_valid = false;
- dc->waiting_LPE = Inkscape::LivePathEffect::INVALID_LPE;
+ dc->waiting_LPE_type = Inkscape::LivePathEffect::INVALID_LPE;
new (&dc->sel_changed_connection) sigc::connection();
new (&dc->sel_modified_connection) sigc::connection();
@@ -245,20 +245,20 @@ sp_draw_context_root_handler(SPEventContext *ec, GdkEvent *event)
/*
* If we have an item and a waiting LPE, apply the effect to the item
+ * (spiro spline mode is treated separately)
*/
void
spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item)
{
using namespace Inkscape::LivePathEffect;
- // TODO: sort this out as soon as we use automatic LPE application for other things than spiro mode, too
if (item) {
if (prefs_get_int_attribute("tools.freehand", "spiro-spline-mode", 0)) {
Effect::createAndApply(SPIRO, dc->desktop->doc(), item);
return;
}
- if (dc->waiting_LPE != INVALID_LPE) {
- Effect::createAndApply(dc->waiting_LPE, dc->desktop->doc(), item);
+ if (dc->waiting_LPE_type != INVALID_LPE) {
+ Effect::createAndApply(dc->waiting_LPE_type, dc->desktop->doc(), item);
}
}
}
@@ -270,6 +270,8 @@ spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item)
static void
spdc_selection_changed(Inkscape::Selection *sel, SPDrawContext *dc)
{
+ // note: in draw context, selection_changed() is only called when a new item was created;
+ // otherwise the following function call would yield wrong results
spdc_check_for_and_apply_waiting_LPE(dc, sel->singleItem());
if (dc->attach) {