Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

Here's a simple patch to scale arrow heads with stroke width when reading a Visio file. The scaling factor is calculated to be close to 2.54*strokeWidth while tending to 0.1 when strokeWidth tends to 0.

Cheers,

Bruno

From fc8f6fd56de47d5b2026ad34072977748c4c9d30 Mon Sep 17 00:00:00 2001
From: Bruno Girin <brunogirin@gmail.com>
Date: Sat, 28 Jan 2012 14:52:03 +0000
Subject: [PATCH] Fix for ticket 44576

---
 src/lib/VSDXContentCollector.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index fa1d5cf..2a4b36f 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -453,13 +453,13 @@ void libvisio::VSDXContentCollector::_lineProperties(double strokeWidth, 
Colour
   {
     m_styleProps.insert("draw:marker-start-viewbox", "0 0 20 30");
     m_styleProps.insert("draw:marker-start-path", "m10 0-10 30h20z");
-    m_styleProps.insert("draw:marker-start-width", m_scale*0.118);
+    m_styleProps.insert("draw:marker-start-width", 
m_scale*(0.1/(strokeWidth*strokeWidth+1)+2.54*strokeWidth));
   }
   if (endMarker > 0)
   {
     m_styleProps.insert("draw:marker-end-viewbox", "0 0 20 30");
     m_styleProps.insert("draw:marker-end-path", "m10 0-10 30h20z");
-    m_styleProps.insert("draw:marker-end-width", m_scale*0.118);
+    m_styleProps.insert("draw:marker-end-width", 
m_scale*(0.1/(strokeWidth*strokeWidth+1)+2.54*strokeWidth));
   }
 }
 
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.