summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-13 17:05:21 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-13 17:05:21 +0000
commit7b00e5ffe385b53d5b95ebfcc63b0dc54f892a3b (patch)
tree9d1d189db1903a66496f26d8964e8713ee3d78d6
parentFixed bugs pointed by su_v. (diff)
parentReally add new text-decoration properties. (diff)
downloadinkscape-7b00e5ffe385b53d5b95ebfcc63b0dc54f892a3b.tar.gz
inkscape-7b00e5ffe385b53d5b95ebfcc63b0dc54f892a3b.zip
update to trunk
(bzr r13682.1.7)
-rw-r--r--share/attributes/cssprops10
-rwxr-xr-xshare/attributes/genMapDataCSS.pl26
-rw-r--r--src/live_effects/effect.cpp9
-rw-r--r--src/object-test.h24
-rw-r--r--src/style-internal.h12
-rw-r--r--src/ui/tools/node-tool.cpp2
6 files changed, 76 insertions, 7 deletions
diff --git a/share/attributes/cssprops b/share/attributes/cssprops
index aefb60cc1..1f8be6b16 100644
--- a/share/attributes/cssprops
+++ b/share/attributes/cssprops
@@ -124,6 +124,16 @@
"text-decoration" - "altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan"
+"text-decoration-color" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan"
+
+"text-decoration-fill" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan"
+
+"text-decoration-line" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan"
+
+"text-decoration-stroke" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan"
+
+"text-decoration-style" - "a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use","altGlyph","textPath","text","tref","tspan","flowRoot","flowPara","flowSpan"
+
"text-rendering" - "text","a","defs","glyph","g","marker","mask","missing-glyph","pattern","svg","switch","symbol","use"
"title" - "circle","ellipse","image","line","path","polygon","polyline","rect","text","use","g"
diff --git a/share/attributes/genMapDataCSS.pl b/share/attributes/genMapDataCSS.pl
index 9b013c758..438c26d04 100755
--- a/share/attributes/genMapDataCSS.pl
+++ b/share/attributes/genMapDataCSS.pl
@@ -210,6 +210,32 @@ push @{$properties{ "solid-opacity" }->{elements}}, @graphics_elements;
$properties{ "solid-opacity" }->{default} = "1.0";
$properties{ "solid-opacity" }->{inherit} = "no";
+# CSS Text Decoration
+push @{$properties{ "text-decoration-line" }->{elements}}, @container_elements;
+push @{$properties{ "text-decoration-line" }->{elements}}, @text_content_elements;
+$properties{ "text-decoration-line" }->{default} = "none";
+$properties{ "text-decoration-line" }->{inherit} = "no";
+
+push @{$properties{ "text-decoration-color" }->{elements}}, @container_elements;
+push @{$properties{ "text-decoration-color" }->{elements}}, @text_content_elements;
+$properties{ "text-decoration-color" }->{default} = "NO_DEFAULT";
+$properties{ "text-decoration-color" }->{inherit} = "no";
+
+push @{$properties{ "text-decoration-style" }->{elements}}, @container_elements;
+push @{$properties{ "text-decoration-style" }->{elements}}, @text_content_elements;
+$properties{ "text-decoration-color" }->{default} = "solid";
+$properties{ "text-decoration-color" }->{inherit} = "no";
+
+push @{$properties{ "text-decoration-fill" }->{elements}}, @container_elements;
+push @{$properties{ "text-decoration-fill" }->{elements}}, @text_content_elements;
+$properties{ "text-decoration-fill" }->{default} = "NO_DEFAULT";
+$properties{ "text-decoration-fill" }->{inherit} = "no";
+
+push @{$properties{ "text-decoration-stroke" }->{elements}}, @container_elements;
+push @{$properties{ "text-decoration-stroke" }->{elements}}, @text_content_elements;
+$properties{ "text-decoration-stroke" }->{default} = "NO_DEFAULT";
+$properties{ "text-decoration-stroke" }->{inherit} = "no";
+
# Output
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);