From 15b391f6070a42aa1bd95775539b3040e0886447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 30 Mar 2005 22:24:40 +0000 Subject: [PATCH] more correct implementation, forgot header again git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12173 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/servers/app/Painter.h | 13 +++++++------ src/servers/app/drawing/Painter/Painter.cpp | 11 +++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/headers/private/servers/app/Painter.h b/headers/private/servers/app/Painter.h index d8d19606af..bf79887c8c 100644 --- a/headers/private/servers/app/Painter.h +++ b/headers/private/servers/app/Painter.h @@ -165,24 +165,24 @@ class Painter { const pattern& p = B_SOLID_HIGH) const; // strings - void DrawChar( char aChar); + BRect DrawChar( char aChar); - void DrawChar( char aChar, + BRect DrawChar( char aChar, BPoint baseLine); - void DrawString( const char* utf8String, + BRect DrawString( const char* utf8String, uint32 length, const escapement_delta* delta = NULL); - void DrawString( const char* utf8String, + BRect DrawString( const char* utf8String, uint32 length, BPoint baseLine, const escapement_delta* delta = NULL); - void DrawString( const char* utf8String, + BRect DrawString( const char* utf8String, const escapement_delta* delta = NULL); - void DrawString( const char* utf8String, + BRect DrawString( const char* utf8String, BPoint baseLine, const escapement_delta* delta = NULL); @@ -224,6 +224,7 @@ class Painter { void _Transform(float* width) const; float _Transform(const float& width) const; void _Transform(BRect* rect) const; + BRect _Transform(const BRect& rect) const; void _RebuildClipping(); diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 6757d7e778..e9106be87e 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -787,6 +787,8 @@ Painter::DrawString(const char* utf8String, uint32 length, transform.TranslateBy(baseLine); transform.Transform(&fPenLocation); } + if (bounds.IsValid() && fClippingRegion) + bounds = bounds & _Transform(fClippingRegion->Frame()); return bounds; } @@ -1000,6 +1002,15 @@ Painter::_Transform(BRect* rect) const rect->bottom--; } +// _Transform +BRect +Painter::_Transform(const BRect& rect) const +{ + BRect ret = rect; + _Transform(&ret); + return ret; +} + // _RebuildClipping void Painter::_RebuildClipping()