Check if the Painter even has a clipping region set before trying to take the

short cut when no text needs to be rendered. I've seen a crash yesterday in
the app_server test environment when the decorater was drawing something,
although it may also have been because I had a screwed up objects folder
where some objects were not recompiled because I am switching back and forth
between two app_server code folders.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26323 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-07-08 17:41:15 +00:00
parent bafcc63bcc
commit 93016537eb
+8 -6
View File
@@ -1067,12 +1067,14 @@ DrawingEngine::DrawString(const char* string, int32 length,
BPoint penLocation = pt;
// try a fast clipping path
float fontSize = fPainter->Font().Size();
BRect clippingFrame = fPainter->ClippingRegion()->Frame();
if (pt.x > clippingFrame.right || pt.y + fontSize < clippingFrame.top
|| pt.y - fontSize > clippingFrame.bottom) {
penLocation.x += StringWidth(string, length, delta);
return penLocation;
if (fPainter->ClippingRegion()) {
float fontSize = fPainter->Font().Size();
BRect clippingFrame = fPainter->ClippingRegion()->Frame();
if (pt.x > clippingFrame.right || pt.y + fontSize < clippingFrame.top
|| pt.y - fontSize > clippingFrame.bottom) {
penLocation.x += StringWidth(string, length, delta);
return penLocation;
}
}
// use a FontCacheRefernece to speed up the second pass of