summaryrefslogtreecommitdiffstats
path: root/src/lpe-tool-context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lpe-tool-context.cpp')
-rw-r--r--src/lpe-tool-context.cpp17
1 files changed, 17 insertions, 0 deletions
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
@@ -323,6 +323,23 @@ lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type) {
}
/*
+ * 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.
*/