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


Hi,

in createPolygonFromRect the interval [0,1] is scaled to [width/2,height/2]. Hence rx and ry have to be divided by width/2 and height/2 respectively - I totally agree with Marco (cf. Re: svgreader.cxx: XML_RECT question).

The attached rounded_rect.svg tests the case that rx=width/2 and ry=height/2 which should be rendered as an ellipse.

Christina
From aef35520a80a7660c51bbe4a8faf40951abddb86 Mon Sep 17 00:00:00 2001
From: "Chr. Rossmanith" <Chr.Rossmanith@gmx.de>
Date: Sat, 28 Apr 2012 19:41:35 +0200
Subject: [PATCH] Correct handling of corner radii of rectangles

---
 filter/source/svg/svgreader.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index f6dc668..23794a7 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -1335,7 +1335,7 @@ struct ShapeWritingVisitor
                 basegfx::B2DPolygon aPoly;
                 aPoly = basegfx::tools::createPolygonFromRect(
                     basegfx::B2DRange(x,y,x+width,y+height),
-                    rx/width, ry/height );
+                    rx/(0.5*width), ry/(0.5*height) );
 
                 writePathShape(xAttrs,
                                xUnoAttrs,
@@ -2179,7 +2179,7 @@ struct ShapeRenderingVisitor
                 basegfx::B2DPolygon aPoly;
                 aPoly = basegfx::tools::createPolygonFromRect(
                     basegfx::B2DRange(x,y,x+width,y+height),
-                    rx, ry );
+                    rx/(0.5*width), ry/(0.5*height) );
 
                 renderPathShape(basegfx::B2DPolyPolygon(aPoly));
                 break;
-- 
1.7.9.5


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.