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
@@ -1067,6 +1067,7 @@ DrawingEngine::DrawString(const char* string, int32 length,
BPoint penLocation = pt; BPoint penLocation = pt;
// try a fast clipping path // try a fast clipping path
if (fPainter->ClippingRegion()) {
float fontSize = fPainter->Font().Size(); float fontSize = fPainter->Font().Size();
BRect clippingFrame = fPainter->ClippingRegion()->Frame(); BRect clippingFrame = fPainter->ClippingRegion()->Frame();
if (pt.x > clippingFrame.right || pt.y + fontSize < clippingFrame.top if (pt.x > clippingFrame.right || pt.y + fontSize < clippingFrame.top
@@ -1074,6 +1075,7 @@ DrawingEngine::DrawString(const char* string, int32 length,
penLocation.x += StringWidth(string, length, delta); penLocation.x += StringWidth(string, length, delta);
return penLocation; return penLocation;
} }
}
// use a FontCacheRefernece to speed up the second pass of // use a FontCacheRefernece to speed up the second pass of
// drawing the string // drawing the string