Re: svgreader.cxx: XML_RECT question

2012-05-03 Thread Thorsten Behrens
Marco Cecchetti wrote:
 Btw I have no idea which user action the ShapeRenderingVisitor
 is triggered by.
 
Hi Marco,

sigh, yeah, as mentioned in another mail - the whole importSvg() is
dead code by now, sorry for having missed that earlier when
Christina started consolidating stuff - commit
48c61f72dd9e205f3d44838ae21cde0419538f1c changed the internal svg
importer to use vcl::SVGReader (see
svtools/source/filter/filter.cxx's IMP_SVG code path).

Cheers,

-- Thorsten


pgpVaqlYB96Sz.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: svgreader.cxx: XML_RECT question

2012-04-28 Thread Marco Cecchetti
On Sat, 28 Apr 2012 00:35:26 +0200, Marco Cecchetti mrcek...@gmail.com  
wrote:


On Fri, 27 Apr 2012 23:03:41 +0200, Christina Roßmanith  
chrrossman...@gmx.de wrote:



Hi,

there are two case XML_RECT blocks in svgreader.cxx in two different  
visitors. The ShapeWritingVisitor scales rx and ry with width and  
height, the ShapeRenderingVisitor does not apply any scaling. I guess  
both visitors should treat rx and ry the same way?


Looking at basegfx::tools::createPolygonFromRect implementation
(in basegfx/source/polygon/b2dpoligontools.cxx) the routine expects
radii (rx, ry) in the [0,1] range and if not they are cropped
to 0 or 1. So the scaled input should be the correct one.
However I think it is better if you perform some visual test.



Well, I have thought again to createPolygonFromRect implementation,
because I had the feeling I had missed something.
If rx is the radius how could the value 1 be a valid input ?
In fact rx/width == 1 = rx == width, but the corner radius along
the x-axis should be = width/2.

These lines from the createPolygonFromRect implementation:

const double fBowX((rRect.getWidth() / 2.0) * fRadiusX);
const double fBowY((rRect.getHeight() / 2.0) * fRadiusY);

confirmed to me that the rx argument is required to be a fraction
of width/2 and the ry argument to be a fraction of height/2.

So the XML_RECT case implementation is wrong in the
ShapeWritingVisitor, too. The passed radii have to be:
rx / (width/2) and ry / (height/2).

In fact, by opening the attached svg file with Inkscape
(or in a browser) and in Draw you can see that corner
rounding is different.

Btw I have no idea which user action the ShapeRenderingVisitor
is triggered by.

Cheers,
-- Marco


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/attachment: rounded_rect.svg___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


svgreader.cxx: XML_RECT question

2012-04-27 Thread Christina Roßmanith

Hi,

there are two case XML_RECT blocks in svgreader.cxx in two different 
visitors. The ShapeWritingVisitor scales rx and ry with width and 
height, the ShapeRenderingVisitor does not apply any scaling. I guess 
both visitors should treat rx and ry the same way?


Christina
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: svgreader.cxx: XML_RECT question

2012-04-27 Thread Marco Cecchetti
On Fri, 27 Apr 2012 23:03:41 +0200, Christina Roßmanith  
chrrossman...@gmx.de wrote:



Hi,

there are two case XML_RECT blocks in svgreader.cxx in two different  
visitors. The ShapeWritingVisitor scales rx and ry with width and  
height, the ShapeRenderingVisitor does not apply any scaling. I guess  
both visitors should treat rx and ry the same way?


Looking at basegfx::tools::createPolygonFromRect implementation
(in basegfx/source/polygon/b2dpoligontools.cxx) the routine expects
radii (rx, ry) in the [0,1] range and if not they are cropped
to 0 or 1. So the scaled input should be the correct one.
However I think it is better if you perform some visual test.

-- Marco


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice