* round of baseline position for DrawString()

-> fixes some clipping problems (because of
  hinting, the text was displayed at a rounded
  position anyways, but the clipping calculation
  was screwed up)
* take the drawing_mode and low color from the
  current state for drawing line arrays


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15800 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2006-01-02 18:11:15 +00:00
parent 4d2cd8d601
commit fd7d912ff6
3 changed files with 15 additions and 3 deletions

View File

@ -942,9 +942,11 @@ DrawingEngine::StrokeLineArray(int32 numLines,
data = (const LineArrayData *)&(linedata[0]);
DrawState context;
context.SetDrawingMode(B_OP_COPY);
context.SetDrawingMode(d->GetDrawingMode());
context.SetLowColor(d->LowColor());
context.SetHighColor(data->color);
context.SetPenSize(d->PenSize());
// pen size is already correctly scaled
fPainter->SetDrawState(&context);

View File

@ -937,6 +937,11 @@ Painter::DrawString(const char* utf8String, uint32 length,
{
CHECK_CLIPPING
if (!fSubpixelPrecise) {
baseLine.x = roundf(baseLine.x);
baseLine.y = roundf(baseLine.y);
}
BRect bounds(0.0, 0.0, -1.0, -1.0);
SetPattern(B_SOLID_HIGH);
@ -958,9 +963,14 @@ Painter::DrawString(const char* utf8String, uint32 length,
// BoundingBox
BRect
Painter::BoundingBox(const char* utf8String, uint32 length,
const BPoint& baseLine, BPoint* penLocation,
BPoint baseLine, BPoint* penLocation,
const escapement_delta* delta) const
{
if (!fSubpixelPrecise) {
baseLine.x = roundf(baseLine.x);
baseLine.y = roundf(baseLine.y);
}
static BRect dummy;
return fTextRenderer->RenderString(utf8String,
length,

View File

@ -179,7 +179,7 @@ class Painter {
BRect BoundingBox( const char* utf8String,
uint32 length,
const BPoint& baseLine,
BPoint baseLine,
BPoint* penLocation,
const escapement_delta* delta = NULL) const;