summaryrefslogtreecommitdiffstats
path: root/src/live_effects/effect.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-01-02 20:18:59 +0000
committerJabiertxof <jtx@jtx>2017-01-02 20:18:59 +0000
commitea0de461574893c3b21e4653d0185cec501e0efe (patch)
tree14f010634714b3f26ca1b75245c237bafe9e8e85 /src/live_effects/effect.cpp
parentFixing paths (diff)
downloadinkscape-ea0de461574893c3b21e4653d0185cec501e0efe.tar.gz
inkscape-ea0de461574893c3b21e4653d0185cec501e0efe.zip
Remove clone original code
(bzr r15295.1.47)
Diffstat (limited to 'src/live_effects/effect.cpp')
-rw-r--r--src/live_effects/effect.cpp41
1 files changed, 14 insertions, 27 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index 81a512d23..5cc0d6f20 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -116,7 +116,7 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{RULER, N_("Ruler"), "ruler"},
/* 0.91 */
{POWERSTROKE, N_("Power stroke"), "powerstroke"},
- {CLONE_ORIGINAL, N_("Clone original"), "clone_original"},
+ {CLONE_ORIGINAL, N_("Clone original path"), "clone_original"},
/* 0.92 */
{SIMPLIFY, N_("Simplify"), "simplify"},
{LATTICE2, N_("Lattice Deformation 2"), "lattice2"},
@@ -356,7 +356,7 @@ Effect::Effect(LivePathEffectObject *lpeobject)
sp_lpe_item(NULL),
current_zoom(1),
upd_params(true),
- sp_shape(NULL),
+ sp_curve(NULL),
provides_own_flash_paths(true), // is automatically set to false if providesOwnFlashPaths() is not overridden
is_ready(false) // is automatically set to false if providesOwnFlashPaths() is not overridden
{
@@ -392,9 +392,9 @@ Effect::doOnApply (SPLPEItem const*/*lpeitem*/)
}
void
-Effect::setSelectedNodePoints(std::vector<Geom::Point> selected_np)
+Effect::setSelectedNodePoints(std::vector<Geom::Point> sNP)
{
- selected_nodes_points = selected_np;
+ selectedNodesPoints = sNP;
}
void
@@ -404,16 +404,16 @@ Effect::setCurrentZoom(double cZ)
}
bool
-Effect::isNodePointSelected(Geom::Point const &node_point) const
+Effect::isNodePointSelected(Geom::Point const &nodePoint) const
{
- if (selected_nodes_points.size() > 0) {
+ if (selectedNodesPoints.size() > 0) {
using Geom::X;
using Geom::Y;
- for (std::vector<Geom::Point>::const_iterator i = selected_nodes_points.begin();
- i != selected_nodes_points.end(); ++i) {
+ for (std::vector<Geom::Point>::const_iterator i = selectedNodesPoints.begin();
+ i != selectedNodesPoints.end(); ++i) {
Geom::Point p = *i;
Geom::Affine transformCoordinate = sp_lpe_item->i2dt_affine();
- Geom::Point p2(node_point[X], node_point[Y]);
+ Geom::Point p2(nodePoint[X],nodePoint[Y]);
p2 *= transformCoordinate;
if (Geom::are_near(p, p2, 0.01)) {
return true;
@@ -446,24 +446,21 @@ void Effect::doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/)
void Effect::doOnApply_impl(SPLPEItem const* lpeitem)
{
sp_lpe_item = const_cast<SPLPEItem *>(lpeitem);
- SPShape * shape = dynamic_cast<SPShape *>(sp_lpe_item);
- if(shape){
- setCurrentShape(shape);
- }
+ /*sp_curve = SP_SHAPE(sp_lpe_item)->getCurve();
+ pathvector_before_effect = sp_curve->get_pathvector();*/
doOnApply(lpeitem);
}
void Effect::doBeforeEffect_impl(SPLPEItem const* lpeitem)
{
sp_lpe_item = const_cast<SPLPEItem *>(lpeitem);
- //Groups set shape in performPathEffect before each call to doEffect
+ //printf("(SPLPEITEM*) %p\n", sp_lpe_item);
SPShape * shape = dynamic_cast<SPShape *>(sp_lpe_item);
if(shape){
- setCurrentShape(shape);
+ sp_curve = shape->getCurve();
+ pathvector_before_effect = sp_curve->get_pathvector();
}
- //printf("(SPLPEITEM*) %p\n", sp_lpe_item);
doBeforeEffect(lpeitem);
-
if (apply_to_clippath_and_mask && SP_IS_GROUP(sp_lpe_item)) {
sp_lpe_item->apply_to_clippath(sp_lpe_item);
sp_lpe_item->apply_to_mask(sp_lpe_item);
@@ -471,16 +468,6 @@ void Effect::doBeforeEffect_impl(SPLPEItem const* lpeitem)
update_helperpath();
}
-void Effect::setCurrentShape(SPShape * shape){
- if(shape){
- sp_shape = shape;
- if (!(sp_curve = sp_shape->getCurve())) {
- // oops
- return;
- }
- pathvector_before_effect = sp_curve->get_pathvector();
- }
-}
/**
* Effects can have a parameter path set before they are applied by accepting a nonzero number of
* mouse clicks. This method activates the pen context, which waits for the specified number of