summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-21 21:23:39 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-21 21:23:39 +0000
commit06adc7b92c491fb3eaa6a6be2a8bb0e940c8ba81 (patch)
treef23254d333553136f1219c599d597d452dd8dabb /src
parentCleanup headers in BSpline LPE (diff)
downloadinkscape-06adc7b92c491fb3eaa6a6be2a8bb0e940c8ba81.tar.gz
inkscape-06adc7b92c491fb3eaa6a6be2a8bb0e940c8ba81.zip
Fix a bug in multi-path-manipulator and finish bspline refactor
(bzr r14026)
Diffstat (limited to 'src')
-rw-r--r--src/ui/tool/multi-path-manipulator.h2
-rw-r--r--src/ui/tool/path-manipulator.cpp26
-rw-r--r--src/ui/tool/path-manipulator.h2
3 files changed, 13 insertions, 17 deletions
diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h
index cdbf34e9d..1bbcdd7ec 100644
--- a/src/ui/tool/multi-path-manipulator.h
+++ b/src/ui/tool/multi-path-manipulator.h
@@ -39,7 +39,7 @@ public:
virtual bool event(Inkscape::UI::Tools::ToolBase *, GdkEvent *event);
bool empty() { return _mmap.empty(); }
- unsigned size() { return _mmap.empty(); }
+ unsigned size() { return _mmap.size(); }
void setItems(std::set<ShapeRecord> const &);
void clear() { _mmap.clear(); }
void cleanup();
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 8b735f3e6..b1e4d641e 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -11,6 +11,7 @@
*/
#include "live_effects/lpe-powerstroke.h"
+#include "live_effects/lpe-bspline.h"
#include "live_effects/lpe-fillet-chamfer.h"
#include <string>
#include <sstream>
@@ -43,7 +44,6 @@
#include "ui/tool/multi-path-manipulator.h"
#include "xml/node.h"
#include "xml/node-observer.h"
-#include "live_effects/lpe-bspline.h"
namespace Inkscape {
namespace UI {
@@ -151,7 +151,7 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path,
_createControlPointsFromGeometry();
//Define if the path is BSpline on construction
- isBSpline(true);
+ recalculateIsBSpline();
}
PathManipulator::~PathManipulator()
@@ -1238,22 +1238,18 @@ int PathManipulator::BSplineGetSteps() const {
}
// determines if the trace has bspline effect
-bool PathManipulator::isBSpline(bool recalculate){
- if(recalculate){
- SPLPEItem * path = dynamic_cast<SPLPEItem *>(_path);
- if (path){
- if(path->hasPathEffect()){
- Inkscape::LivePathEffect::Effect const *thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE);
- if(thisEffect){
- _is_bspline = true;
- return _is_bspline;
- }
+void PathManipulator::recalculateIsBSpline(){
+ SPLPEItem * path = dynamic_cast<SPLPEItem *>(_path);
+ if (path){
+ if(path->hasPathEffect()){
+ Inkscape::LivePathEffect::Effect const *thisEffect = path->getPathEffectOfType(Inkscape::LivePathEffect::BSPLINE);
+ if(thisEffect){
+ _is_bspline = true;
+ return;
}
}
-
}
_is_bspline = false;
- return _is_bspline;
}
bool PathManipulator::isBSpline() const {
@@ -1325,7 +1321,7 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE)
{
Geom::PathBuilder builder;
//Refresh if is bspline some times -think on path change selection, this value get lost
- isBSpline(true);
+ recalculateIsBSpline();
for (std::list<SubpathPtr>::iterator spi = _subpaths.begin(); spi != _subpaths.end(); ) {
SubpathPtr subpath = *spi;
if (subpath->empty()) {
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 4badec569..6dc1c9d09 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -107,7 +107,7 @@ private:
void _createControlPointsFromGeometry();
- bool isBSpline(bool recalculate);
+ void recalculateIsBSpline();
bool isBSpline() const;
double BSplineHandlePosition(Handle *h, Handle *h2 = NULL);
Geom::Point BSplineHandleReposition(Handle *h, Handle *h2 = NULL);