* 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:
@@ -942,9 +942,11 @@ DrawingEngine::StrokeLineArray(int32 numLines,
|
|||||||
data = (const LineArrayData *)&(linedata[0]);
|
data = (const LineArrayData *)&(linedata[0]);
|
||||||
|
|
||||||
DrawState context;
|
DrawState context;
|
||||||
context.SetDrawingMode(B_OP_COPY);
|
context.SetDrawingMode(d->GetDrawingMode());
|
||||||
|
context.SetLowColor(d->LowColor());
|
||||||
context.SetHighColor(data->color);
|
context.SetHighColor(data->color);
|
||||||
context.SetPenSize(d->PenSize());
|
context.SetPenSize(d->PenSize());
|
||||||
|
// pen size is already correctly scaled
|
||||||
|
|
||||||
fPainter->SetDrawState(&context);
|
fPainter->SetDrawState(&context);
|
||||||
|
|
||||||
|
|||||||
@@ -937,6 +937,11 @@ Painter::DrawString(const char* utf8String, uint32 length,
|
|||||||
{
|
{
|
||||||
CHECK_CLIPPING
|
CHECK_CLIPPING
|
||||||
|
|
||||||
|
if (!fSubpixelPrecise) {
|
||||||
|
baseLine.x = roundf(baseLine.x);
|
||||||
|
baseLine.y = roundf(baseLine.y);
|
||||||
|
}
|
||||||
|
|
||||||
BRect bounds(0.0, 0.0, -1.0, -1.0);
|
BRect bounds(0.0, 0.0, -1.0, -1.0);
|
||||||
|
|
||||||
SetPattern(B_SOLID_HIGH);
|
SetPattern(B_SOLID_HIGH);
|
||||||
@@ -958,9 +963,14 @@ Painter::DrawString(const char* utf8String, uint32 length,
|
|||||||
// BoundingBox
|
// BoundingBox
|
||||||
BRect
|
BRect
|
||||||
Painter::BoundingBox(const char* utf8String, uint32 length,
|
Painter::BoundingBox(const char* utf8String, uint32 length,
|
||||||
const BPoint& baseLine, BPoint* penLocation,
|
BPoint baseLine, BPoint* penLocation,
|
||||||
const escapement_delta* delta) const
|
const escapement_delta* delta) const
|
||||||
{
|
{
|
||||||
|
if (!fSubpixelPrecise) {
|
||||||
|
baseLine.x = roundf(baseLine.x);
|
||||||
|
baseLine.y = roundf(baseLine.y);
|
||||||
|
}
|
||||||
|
|
||||||
static BRect dummy;
|
static BRect dummy;
|
||||||
return fTextRenderer->RenderString(utf8String,
|
return fTextRenderer->RenderString(utf8String,
|
||||||
length,
|
length,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class Painter {
|
|||||||
|
|
||||||
BRect BoundingBox( const char* utf8String,
|
BRect BoundingBox( const char* utf8String,
|
||||||
uint32 length,
|
uint32 length,
|
||||||
const BPoint& baseLine,
|
BPoint baseLine,
|
||||||
BPoint* penLocation,
|
BPoint* penLocation,
|
||||||
const escapement_delta* delta = NULL) const;
|
const escapement_delta* delta = NULL) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user