avoid a crash if used without attached buffer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12090 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -612,26 +612,29 @@ Painter::DrawString(const char* utf8String, uint32 length,
|
|||||||
{
|
{
|
||||||
fPatternHandler->SetPattern(B_SOLID_HIGH);
|
fPatternHandler->SetPattern(B_SOLID_HIGH);
|
||||||
|
|
||||||
Transformable transform;
|
if (fBuffer) {
|
||||||
// TODO: convert BFont::Shear(), which is in degrees 45°...135° to whatever AGG is using
|
|
||||||
// transform.ShearBy(B_ORIGIN, fFont.Shear(), 0.0);
|
|
||||||
transform.RotateBy(B_ORIGIN, -fFont.Rotation());
|
|
||||||
transform.TranslateBy(baseLine);
|
|
||||||
transform.ScaleBy(B_ORIGIN, fScale, fScale);
|
|
||||||
transform.TranslateBy(fOrigin);
|
|
||||||
|
|
||||||
fTextRenderer->RenderString(utf8String,
|
Transformable transform;
|
||||||
length,
|
// TODO: convert BFont::Shear(), which is in degrees 45°...135° to whatever AGG is using
|
||||||
fFontRendererSolid,
|
// transform.ShearBy(B_ORIGIN, fFont.Shear(), 0.0);
|
||||||
fFontRendererBin,
|
transform.RotateBy(B_ORIGIN, -fFont.Rotation());
|
||||||
transform,
|
transform.TranslateBy(baseLine);
|
||||||
&fPenLocation);
|
transform.ScaleBy(B_ORIGIN, fScale, fScale);
|
||||||
// pen location is not transformed in quite the same way,
|
transform.TranslateBy(fOrigin);
|
||||||
// or transformations would add up
|
|
||||||
transform.Reset();
|
fTextRenderer->RenderString(utf8String,
|
||||||
transform.RotateBy(B_ORIGIN, -fFont.Rotation());
|
length,
|
||||||
transform.TranslateBy(baseLine);
|
fFontRendererSolid,
|
||||||
transform.Transform(&fPenLocation);
|
fFontRendererBin,
|
||||||
|
transform,
|
||||||
|
&fPenLocation);
|
||||||
|
// pen location is not transformed in quite the same way,
|
||||||
|
// or transformations would add up
|
||||||
|
transform.Reset();
|
||||||
|
transform.RotateBy(B_ORIGIN, -fFont.Rotation());
|
||||||
|
transform.TranslateBy(baseLine);
|
||||||
|
transform.Transform(&fPenLocation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DrawString
|
// DrawString
|
||||||
|
|||||||
Reference in New Issue
Block a user