summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-08-15 09:11:55 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-08-15 09:11:55 +0000
commitdac72fcd64d2fb7e216d5165a8821b722d2eded9 (patch)
tree82949171f4c2b8cf32fef4d20657492ec908b3d3 /src/style-internal.cpp
parentfix a typo (diff)
downloadinkscape-dac72fcd64d2fb7e216d5165a8821b722d2eded9.tar.gz
inkscape-dac72fcd64d2fb7e216d5165a8821b722d2eded9.zip
Relative values for strokes:
Fix segmenation fault on reading dashes with % values. Fix computed value for dashes with % values (use viewport diagonal length). Support % values for stroke width.
Diffstat (limited to 'src/style-internal.cpp')
-rw-r--r--src/style-internal.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index 14b523302..39e334d1f 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -2052,9 +2052,9 @@ SPIDashArray::read( gchar const *str ) {
if( strcmp(str, "none") == 0) {
return;
}
+
std::vector<Glib::ustring> tokens = Glib::Regex::split_simple("[(,\\s|\\s)]+", str);
- gchar *e = NULL;
bool LineSolid = true;
for (auto token : tokens) {
@@ -2062,21 +2062,9 @@ SPIDashArray::read( gchar const *str ) {
spilength.read(token.c_str());
if (spilength.value > 0.00000001)
LineSolid = false;
- double dash = spilength.value;
- // Currently inkscape handle unit conversion in dasharray but need
- // a active document to do it, so put document inside a check for units
- // and supose units are not included in tests
- if (spilength.unit == SPCSSUnit::SP_CSS_UNIT_PERCENT) {
- SPDocument *document = SP_ACTIVE_DOCUMENT;
- dash = document->getViewBox().width() * spilength.value;
- }
- else if (spilength.unit != SPCSSUnit::SP_CSS_UNIT_NONE) {
- SPDocument *document = SP_ACTIVE_DOCUMENT;
- dash = spilength.computed / document->getDocumentScale()[0];
- }
- spilength.setDouble(dash);
values.push_back(spilength);
}
+
if (LineSolid) {
values.clear();
}