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