[Kst] extragear/graphics/kst/src/libkstapp
George Staikos
staikos at kde.org
Sat Jan 6 03:29:51 CET 2007
On 5-Jan-07, at 5:37 PM, Andrew Walker wrote:
> SVN commit 620401 by arwalker:
>
> BUG:129399 Correctly handle the printing of legends and labels.
> This wasn't working properly as the lineWidthAdjustmentFactor() for
> the border wasn't taken into account when printing.
>
> +void KstBorderedViewObject::setContentsRectForDevice(const
> KstPainter& painter, QRect& rect) {
> + const int mpb = (_margin + _padding + _borderWidth) *
> painter.lineWidthAdjustmentFactor();
> + _geom.setX(rect.left() - mpb);
> + _geom.setY(rect.top() - mpb);
> + _geom.setWidth(rect.width() + 2 * mpb);
> + _geom.setHeight(rect.height() + 2 * mpb);
> +}
I see another problem here. _geom is not supposed to be set
directly. The result is that member variables (such as _aspect) are
not updated accordingly. All of this API is very misleading, and
even the inheritence is broken from r305911/r305929. This needs to
be fixed before it's merged into the branch, and the branch is being
merged to trunk within the next 72 hours.
I'm not even sure why we have a setContentsRect. It seems to me
that we want a setGeometry call instead, taking into account the
margin, border, and padding. I guess something like
setGeometryForContentsRect() taking an optional painter pointer is
more appropriate,. What we have at the moment is plain confusing.
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
More information about the Kst
mailing list