Il 9/30/2013 11:59 AM, Uwe Rathmann ha scritto:
> Your modification rounds to integers, what introduces an error -
> depending on the scaling factor ( f.e when exporting to a paint device
> with a much higher resolution than on screen ). You will also see this
> rounding error, when zooming in deep in a PDF viewer.
But also the original code rounds a QRectF into a QRect. I can
understand that 1 is a fixed value and that may be not proper in general.
Anyway removing the RenderAntialiased option from the LegendItem of
"legends" example I get the plot as in the attached images. You can see
br_orig.png is not correct.
Looking at the exported pdf in detail I found somethig I can't explain
but may be helpful. If you give a look at the previous pdf I sent and
zoom it of a 200% at least, you can see a white line close to the top
and left plot margin. On the contrary that white line is not present on
bottom nor on the right. Could be a problem related to the canvasRect
passed to the geometry method then?
> I'm also not sure what will happen when using a border pen with a width
> > 1 ( f.e 10 ). Is the -1 of your patch the correct adjustment then ?
Well, I'm not sure if the geometry( const QRectF &canvasRect ) method
should consider the pen width or not. If so I think that could be easily
handled. But I think this is something more that could be handled: the
behavior seems not proper regardless of the QPen width.