diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-08-18 00:46:24 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-08-18 00:46:24 +0000 |
| commit | 2500b306b4d42f808b16ce42a41c12467c6da3dc (patch) | |
| tree | 64e2571f30440ccf3157f1280d0ca0202815a79d /src/lpe-tool-context.cpp | |
| parent | Icon for lpe-mirror-symmetry (diff) | |
| download | inkscape-2500b306b4d42f808b16ce42a41c12467c6da3dc.tar.gz inkscape-2500b306b4d42f808b16ce42a41c12467c6da3dc.zip | |
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)
Diffstat (limited to 'src/lpe-tool-context.cpp')
| -rw-r--r-- | src/lpe-tool-context.cpp | 17 |
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. */ |
