From 84d91e1c53584458c783820f7e8e341b8617e4cb Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Tue, 11 Nov 2014 17:07:11 -0500 Subject: Add a few more tests (bzr r13703) --- src/object-test.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') 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(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) -- cgit v1.2.3 From 7ff4799d9ecde4286c94e76f4005e18db5a60055 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 12 Nov 2014 01:12:35 +0100 Subject: Fixed bug in node point selection to LPE. (bzr r13704) --- src/live_effects/effect.cpp | 9 ++++++--- src/ui/tools/node-tool.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index ca3b29b66..e49a15dd0 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::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/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(*i); - selectedNodesPositions.push_back(desktop->doc2dt(n->position())); + selectedNodesPositions.push_back(n->position()); } } lpe->setSelectedNodePoints(selectedNodesPositions); -- cgit v1.2.3 From 922a3d737c578c3de5343704f81e0db85e028278 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 12 Nov 2014 18:58:18 +0100 Subject: Fix a bug releasing LPE clip and mask (bzr r13705) --- src/selection-chemistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index d0ef0afea..d00e8d702 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -4186,7 +4186,7 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) { for ( SPObject *child = obj->firstChild() ; child; child = child->getNext() ) { // Collect all clipped paths and masks within a single group Inkscape::XML::Node *copy = SP_OBJECT(child)->getRepr()->duplicate(xml_doc); - if(copy->attribute("inkscape:original-d")) + if(copy->attribute("inkscape:original-d") && copy->attribute("inkscape:path-effect")) { copy->setAttribute("d", copy->attribute("inkscape:original-d")); } -- cgit v1.2.3 From 320bacdb7957098144ee11a015c6614af4f1e6ea Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 12 Nov 2014 20:26:25 +0100 Subject: Add new text decoration properties. (bzr r13706) --- src/style-internal.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') 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: -- cgit v1.2.3