PDA

View Full Version : Text clipped when rendering svg.



ocratato
27th April 2010, 11:34
Hi,

I am attempting to display some SVG, generated by GraphViz dot, and some of the text is being clipped.
The text within boxes and ellipses displays fine.
The text on arcs is also OK unless the arc is nearly horizontal. It appears that text is clipped by a rectangle that surrounds the arc.
To do the displaying I am parsing the SVG/XML and creating an instance of a subclass of QGraphicsSvgItem for each object. I am doing this way so that I can get mouse events from the individual objects.

Does anyone know how I can influence the clipping area for a QGraphicsSvgItem ?

I am using Qt 4.6.2 on Fedora Linux 11.

Thanks
Brenton

ocratato
20th June 2010, 10:03
OK, replying to my own question.

It appears that this relates to a known Qt bug - QTBUG-2002
The problem is that deep inside QSvgGraphics there is a class QSvgText which is responsible for displaying text. It does not recalculate the bounds - the function is simply commented out.

Brenton