* fractional rects need to be aligned if not drawing in subpixel precise mode,
by now, I feel there is too much code involved in this... I guess I should really move this to stuff to ViewLayer::ConvertToScreenForDrawing()... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22223 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -792,7 +792,7 @@ DrawingEngine::FillRect(BRect r)
|
|||||||
CRASH_IF_NOT_LOCKED
|
CRASH_IF_NOT_LOCKED
|
||||||
|
|
||||||
make_rect_valid(r);
|
make_rect_valid(r);
|
||||||
r = fPainter->ClipRect(r);
|
r = fPainter->AlignAndClipRect(r);
|
||||||
if (r.IsValid()) {
|
if (r.IsValid()) {
|
||||||
bool cursorTouched = fGraphicsCard->HideSoftwareCursor(r);
|
bool cursorTouched = fGraphicsCard->HideSoftwareCursor(r);
|
||||||
|
|
||||||
|
|||||||
@@ -561,9 +561,8 @@ Painter::StrokeRect(const BRect& r) const
|
|||||||
{
|
{
|
||||||
CHECK_CLIPPING
|
CHECK_CLIPPING
|
||||||
|
|
||||||
// support invalid rects
|
BPoint a(r.left, r.top);
|
||||||
BPoint a(min_c(r.left, r.right), min_c(r.top, r.bottom));
|
BPoint b(r.right, r.bottom);
|
||||||
BPoint b(max_c(r.left, r.right), max_c(r.top, r.bottom));
|
|
||||||
_Transform(&a, false);
|
_Transform(&a, false);
|
||||||
_Transform(&b, false);
|
_Transform(&b, false);
|
||||||
|
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ class Painter {
|
|||||||
BRect InvertRect( const BRect& r) const;
|
BRect InvertRect( const BRect& r) const;
|
||||||
|
|
||||||
inline BRect ClipRect( BRect rect) const;
|
inline BRect ClipRect( BRect rect) const;
|
||||||
|
inline BRect AlignAndClipRect(BRect rect) const;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _Transform(BPoint* point,
|
void _Transform(BPoint* point,
|
||||||
@@ -290,6 +292,21 @@ Painter::ClipRect(BRect rect) const
|
|||||||
return _Clipped(rect);
|
return _Clipped(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline BRect
|
||||||
|
Painter::AlignAndClipRect(BRect rect) const
|
||||||
|
{
|
||||||
|
rect.left = floorf(rect.left);
|
||||||
|
rect.top = floorf(rect.top);
|
||||||
|
if (fSubpixelPrecise) {
|
||||||
|
rect.right = ceilf(rect.right);
|
||||||
|
rect.bottom = ceilf(rect.bottom);
|
||||||
|
} else {
|
||||||
|
rect.right = floorf(rect.right);
|
||||||
|
rect.bottom = floorf(rect.bottom);
|
||||||
|
}
|
||||||
|
return _Clipped(rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // PAINTER_H
|
#endif // PAINTER_H
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user