diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-05-19 15:52:07 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-05-19 15:52:07 +0000 |
| commit | 09089a141e8d8f5073bc4f767c02efc0fec711b1 (patch) | |
| tree | 84b3185967f39d8bc3c010e0ecf05f6c42ee4ca0 /src/object-edit.cpp | |
| parent | fixed broken intltool-update command :) (diff) | |
| download | inkscape-09089a141e8d8f5073bc4f767c02efc0fec711b1.tar.gz inkscape-09089a141e8d8f5073bc4f767c02efc0fec711b1.zip | |
Provide knotholder for LPEPerpBisector; TODO: this replaces the usual nodepath in node context but in the long run it is desired to use both along with each other
(bzr r5701)
Diffstat (limited to 'src/object-edit.cpp')
| -rw-r--r-- | src/object-edit.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/object-edit.cpp b/src/object-edit.cpp index 65b256b34..46ab877b6 100644 --- a/src/object-edit.cpp +++ b/src/object-edit.cpp @@ -32,6 +32,7 @@ #include "desktop.h" #include "desktop-handles.h" #include "sp-namedview.h" +#include "live_effects/effect.h" #include "sp-pattern.h" #include "sp-path.h" @@ -44,7 +45,7 @@ #include "xml/repr.h" -#include "isnan.h" +#include "2geom/isnan.h" #define sp_round(v,m) (((v) < 0.0) ? ((ceil((v) / (m) - 0.5)) * (m)) : ((floor((v) / (m) + 0.5)) * (m))) @@ -58,9 +59,23 @@ static SPKnotHolder *sp_misc_knot_holder(SPItem *item, SPDesktop *desktop); static SPKnotHolder *sp_flowtext_knot_holder(SPItem *item, SPDesktop *desktop); static void sp_pat_knot_holder(SPItem *item, SPKnotHolder *knot_holder); +static SPKnotHolder *sp_lpe_knot_holder(SPItem *item, SPDesktop *desktop) +{ + SPKnotHolder *knot_holder = sp_knot_holder_new(desktop, item, NULL); + + Inkscape::LivePathEffect::Effect *effect = sp_lpe_item_get_livepatheffect(SP_LPE_ITEM(item)); + effect->addHandles(knot_holder); + + return knot_holder; +} + SPKnotHolder * sp_item_knot_holder(SPItem *item, SPDesktop *desktop) { + if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(item)) && + sp_lpe_item_get_livepatheffect(SP_LPE_ITEM(item))->providesKnotholder()) { + return sp_lpe_knot_holder(item, desktop); + } else if (SP_IS_RECT(item)) { return sp_rect_knot_holder(item, desktop); } else if (SP_IS_BOX3D(item)) { @@ -1101,7 +1116,7 @@ sp_spiral_outer_set(SPItem *item, NR::Point const &p, NR::Point const &/*origin* spiral->rad = rad_new; spiral->t0 = pow(r0 / spiral->rad, 1.0/spiral->exp); } - if (!isFinite(spiral->t0)) spiral->t0 = 0.0; + if (!IS_FINITE(spiral->t0)) spiral->t0 = 0.0; spiral->t0 = CLAMP(spiral->t0, 0.0, 0.999); } |
