From 2500b306b4d42f808b16ce42a41c12467c6da3dc Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Mon, 18 Aug 2008 00:46:24 +0000 Subject: Add action to change the end type of line segments if an item has LPELineSegment applied; this is for demonstration purposes because later it would be nice if we could change widgets interactively. (bzr r6683) --- src/lpe-tool-context.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/lpe-tool-context.cpp') diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index fb252729d..f7b0091ec 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -322,6 +322,23 @@ lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type) { return -1; } +/* + * Checks whether an item has a construction applied as LPE and if so returns the index in + * lpesubtools of this construction + */ +int lpetool_item_has_construction(SPLPEToolContext *lc, SPItem *item) +{ + if (!SP_IS_LPE_ITEM(item)) { + return -1; + } + + Inkscape::LivePathEffect::Effect* lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item)); + if (!lpe) { + return -1; + } + return lpetool_mode_to_index(lpe->effectType()); +} + /* * Attempts to perform the construction of the given type (i.e., to apply the corresponding LPE) to * a single selected item. Returns whether we succeeded. -- cgit v1.2.3