From e749c485ed1ffae3ff28aead46951796cc47f084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 26 Aug 2007 14:31:49 +0000 Subject: [PATCH] * this fixes the second part of #1426, unfortunately, the clipping checks have become more expensive, so maybe it is better to do what I proposed in the ticket comments, and move the rounding of drawing command coordinates into ViewLayer::ConvertToTopForDrawing() instead of handling it in DrawingEngine and Painter git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22060 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/servers/app/drawing/Painter/Painter.h b/src/servers/app/drawing/Painter/Painter.h index b28c1e46f6..96cf6305bc 100644 --- a/src/servers/app/drawing/Painter/Painter.h +++ b/src/servers/app/drawing/Painter/Painter.h @@ -191,8 +191,7 @@ class Painter { BRect InvertRect( const BRect& r) const; - inline BRect ClipRect(const BRect& rect) const - { return _Clipped(rect); } + inline BRect ClipRect( BRect rect) const; private: void _Transform(BPoint* point, @@ -281,6 +280,17 @@ mutable AGGTextRenderer fTextRenderer; }; +inline BRect +Painter::ClipRect(BRect rect) const +{ + rect.left = floorf(rect.left); + rect.top = floorf(rect.top); + rect.right = ceilf(rect.right); + rect.bottom = ceilf(rect.bottom); + return _Clipped(rect); +} + + #endif // PAINTER_H