diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/effect.cpp | 9 | ||||
| -rw-r--r-- | src/object-test.h | 24 | ||||
| -rw-r--r-- | src/style-internal.h | 12 | ||||
| -rw-r--r-- | src/ui/tools/node-tool.cpp | 2 |
4 files changed, 40 insertions, 7 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 37fd64539..eb649db62 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -413,12 +413,15 @@ bool Effect::isNodePointSelected(Geom::Point const &nodePoint) const { if (selectedNodesPoints.size() > 0) { + using Geom::X; + using Geom::Y; for (std::vector<Geom::Point>::const_iterator i = selectedNodesPoints.begin(); i != selectedNodesPoints.end(); ++i) { Geom::Point p = *i; - p[Geom::X] = Inkscape::Util::Quantity::convert(p[Geom::X], "px", *defaultUnit); - p[Geom::Y] = Inkscape::Util::Quantity::convert(p[Geom::Y], "px", *defaultUnit); - if (Geom::are_near(p, nodePoint, 0.01)) { + Geom::Affine transformCoordinate = sp_lpe_item->i2dt_affine(); + Geom::Point p2(nodePoint[X],nodePoint[Y]); + p2 *= transformCoordinate; + if (Geom::are_near(p, p2, 0.01)) { return true; } } diff --git a/src/object-test.h b/src/object-test.h index 77e9afa86..d6a9dbbd3 100644 --- a/src/object-test.h +++ b/src/object-test.h @@ -95,6 +95,30 @@ public: SPGroup *group = dynamic_cast<SPGroup *>(doc->getObjectById("G")); testGrouping(group); + + // Test parent behavior + SPObject *child = root->firstChild(); + assert(child != NULL); + TS_ASSERT(child->parent == root); + TS_ASSERT(child->document == doc); + TS_ASSERT(root->isAncestorOf(child)); + + // Test list behavior + SPObject *next = child->getNext(); + SPObject *prev = next; + TS_ASSERT(next->getPrev() == child); + prev = next; + next = next->getNext(); + while (next != NULL) { + // Walk the list + TS_ASSERT(next->getPrev() == prev); + prev = next; + next = next->getNext(); + } + TS_ASSERT(child->lastChild() == next); + + // Test hrefcount + TS_ASSERT(path->isReferenced()); } void testClones(SPPath *path) diff --git a/src/style-internal.h b/src/style-internal.h index 32792827a..faae76ac5 100644 --- a/src/style-internal.h +++ b/src/style-internal.h @@ -36,6 +36,12 @@ static const unsigned SP_STYLE_FLAG_ALWAYS (1 << 2); static const unsigned SP_STYLE_FLAG_IFSET (1 << 0); static const unsigned SP_STYLE_FLAG_IFDIFF (1 << 1); +enum SPStyleSrc { + SP_STYLE_SRC_UNSET, + SP_STYLE_SRC_STYLE_PROP, + SP_STYLE_SRC_STYLE_SHEET, + SP_STYLE_SRC_ATTRIBUTE +}; /* General comments: * @@ -113,7 +119,7 @@ public: inherits(inherits), set(false), inherit(false), - style_att(false), + style_src(SP_STYLE_SRC_UNSET), style(NULL) {} @@ -150,7 +156,7 @@ public: inherits = rhs.inherits; set = rhs.set; inherit = rhs.inherit; - style_att = rhs.style_att; + style_src = rhs.style_src; style = rhs.style; return *this; } @@ -170,7 +176,7 @@ public: unsigned inherits : 1; // Property inherits by default from parent. unsigned set : 1; // Property has been explicitly set (vs. inherited). unsigned inherit : 1; // Property value set to 'inherit'. - unsigned style_att : 2; // Source (attribute, style attribute, style-sheet). NOT USED YET FIX ME + SPStyleSrc style_src : 2; // Source (attribute, style attribute, style-sheet). NOT USED YET FIX ME // To do: make private after g_asserts removed public: diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 99d60e2b7..838c2a884 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -310,7 +310,7 @@ void NodeTool::update_helperpath () { for (Inkscape::UI::ControlPointSelection::Set::iterator i = selectionNodes.begin(); i != selectionNodes.end(); ++i) { if ((*i)->selected()) { Inkscape::UI::Node *n = dynamic_cast<Inkscape::UI::Node *>(*i); - selectedNodesPositions.push_back(desktop->doc2dt(n->position())); + selectedNodesPositions.push_back(n->position()); } } lpe->setSelectedNodePoints(selectedNodesPositions); |
