DrawString now modifies the pen position
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10720 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -555,23 +555,38 @@ Painter::FillArc(BPoint center, float xRadius, float yRadius,
|
|||||||
|
|
||||||
// DrawString
|
// DrawString
|
||||||
void
|
void
|
||||||
Painter::DrawString(const char* utf8String, BPoint baseLine) const
|
Painter::DrawString(const char* utf8String, const escapement_delta* delta)
|
||||||
|
{
|
||||||
|
// TODO: to be moved elsewhere
|
||||||
|
DrawString(utf8String, fPenLocation, delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DrawString
|
||||||
|
void
|
||||||
|
Painter::DrawString(const char* utf8String, BPoint baseLine,
|
||||||
|
const escapement_delta* delta)
|
||||||
{
|
{
|
||||||
fPatternHandler->SetPattern(B_SOLID_HIGH);
|
fPatternHandler->SetPattern(B_SOLID_HIGH);
|
||||||
|
|
||||||
_Transform(&baseLine);
|
|
||||||
|
|
||||||
Transformable transform;
|
Transformable transform;
|
||||||
// TODO: convert BFont::Shear(), which is in degrees 45°...135° to whatever AGG is using
|
// TODO: convert BFont::Shear(), which is in degrees 45°...135° to whatever AGG is using
|
||||||
// transform.ShearBy(B_ORIGIN, fFont.Shear(), 0.0);
|
// transform.ShearBy(B_ORIGIN, fFont.Shear(), 0.0);
|
||||||
transform.RotateBy(B_ORIGIN, -fFont.Rotation());
|
transform.RotateBy(B_ORIGIN, -fFont.Rotation());
|
||||||
transform.ScaleBy(B_ORIGIN, fScale, fScale);
|
|
||||||
transform.TranslateBy(baseLine);
|
transform.TranslateBy(baseLine);
|
||||||
|
transform.ScaleBy(B_ORIGIN, fScale, fScale);
|
||||||
|
transform.TranslateBy(fOrigin);
|
||||||
|
|
||||||
fTextRenderer->RenderString(utf8String,
|
fTextRenderer->RenderString(utf8String,
|
||||||
fFontRendererSolid,
|
fFontRendererSolid,
|
||||||
fFontRendererBin,
|
fFontRendererBin,
|
||||||
transform);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|||||||
@@ -132,7 +132,11 @@ class Painter {
|
|||||||
|
|
||||||
// strings
|
// strings
|
||||||
void DrawString( const char* utf8String,
|
void DrawString( const char* utf8String,
|
||||||
BPoint baseLine) const;
|
const escapement_delta* delta = NULL);
|
||||||
|
|
||||||
|
void DrawString( const char* utf8String,
|
||||||
|
BPoint baseLine,
|
||||||
|
const escapement_delta* delta = NULL);
|
||||||
|
|
||||||
// bitmaps
|
// bitmaps
|
||||||
void DrawBitmap( const BBitmap* bitmap,
|
void DrawBitmap( const BBitmap* bitmap,
|
||||||
@@ -157,13 +161,6 @@ class Painter {
|
|||||||
void DrawChar( char aChar,
|
void DrawChar( char aChar,
|
||||||
BPoint location);
|
BPoint location);
|
||||||
|
|
||||||
void DrawString( const char* string,
|
|
||||||
const escapement_delta* delta = NULL);
|
|
||||||
|
|
||||||
void DrawString( const char* string,
|
|
||||||
BPoint location,
|
|
||||||
const escapement_delta* delta = NULL);
|
|
||||||
|
|
||||||
void DrawString( const char* string,
|
void DrawString( const char* string,
|
||||||
int32 length,
|
int32 length,
|
||||||
const escapement_delta* delta = NULL);
|
const escapement_delta* delta = NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user