app_server: Apply scale to round corner radius.
This commit is contained in:
@@ -293,19 +293,26 @@ fill_rect(DrawingContext* context, BRect rect)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stroke_round_rect(DrawingContext* context, BRect rect, BPoint radii)
|
draw_round_rect(DrawingContext* context, BRect rect, BPoint radii, bool fill)
|
||||||
{
|
{
|
||||||
context->ConvertToScreenForDrawing(&rect);
|
context->ConvertToScreenForDrawing(&rect);
|
||||||
context->GetDrawingEngine()->DrawRoundRect(rect, radii.x,
|
float scale = context->CurrentState()->CombinedScale();
|
||||||
radii.y, false);
|
context->GetDrawingEngine()->DrawRoundRect(rect, radii.x * scale,
|
||||||
|
radii.y * scale, fill);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
stroke_round_rect(DrawingContext* context, BRect rect, BPoint radii)
|
||||||
|
{
|
||||||
|
draw_round_rect(context, rect, radii, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fill_round_rect(DrawingContext* context, BRect rect, BPoint radii)
|
fill_round_rect(DrawingContext* context, BRect rect, BPoint radii)
|
||||||
{
|
{
|
||||||
context->ConvertToScreenForDrawing(&rect);
|
draw_round_rect(context, rect, radii, true);
|
||||||
context->GetDrawingEngine()->DrawRoundRect(rect, radii.x, radii.y, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2451,14 +2451,16 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code,
|
|||||||
Title()));
|
Title()));
|
||||||
|
|
||||||
BRect rect;
|
BRect rect;
|
||||||
float xrad,yrad;
|
float xRadius;
|
||||||
|
float yRadius;
|
||||||
link.Read<BRect>(&rect);
|
link.Read<BRect>(&rect);
|
||||||
link.Read<float>(&xrad);
|
link.Read<float>(&xRadius);
|
||||||
if (link.Read<float>(&yrad) != B_OK)
|
if (link.Read<float>(&yRadius) != B_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
fCurrentView->ConvertToScreenForDrawing(&rect);
|
fCurrentView->ConvertToScreenForDrawing(&rect);
|
||||||
drawingEngine->DrawRoundRect(rect, xrad, yrad,
|
float scale = fCurrentView->CurrentState()->CombinedScale();
|
||||||
|
drawingEngine->DrawRoundRect(rect, xRadius * scale, yRadius * scale,
|
||||||
code == AS_FILL_ROUNDRECT);
|
code == AS_FILL_ROUNDRECT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user