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
|
||||
stroke_round_rect(DrawingContext* context, BRect rect, BPoint radii)
|
||||
draw_round_rect(DrawingContext* context, BRect rect, BPoint radii, bool fill)
|
||||
{
|
||||
context->ConvertToScreenForDrawing(&rect);
|
||||
context->GetDrawingEngine()->DrawRoundRect(rect, radii.x,
|
||||
radii.y, false);
|
||||
float scale = context->CurrentState()->CombinedScale();
|
||||
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
|
||||
fill_round_rect(DrawingContext* context, BRect rect, BPoint radii)
|
||||
{
|
||||
context->ConvertToScreenForDrawing(&rect);
|
||||
context->GetDrawingEngine()->DrawRoundRect(rect, radii.x, radii.y, true);
|
||||
draw_round_rect(context, rect, radii, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2451,14 +2451,16 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code,
|
||||
Title()));
|
||||
|
||||
BRect rect;
|
||||
float xrad,yrad;
|
||||
float xRadius;
|
||||
float yRadius;
|
||||
link.Read<BRect>(&rect);
|
||||
link.Read<float>(&xrad);
|
||||
if (link.Read<float>(&yrad) != B_OK)
|
||||
link.Read<float>(&xRadius);
|
||||
if (link.Read<float>(&yRadius) != B_OK)
|
||||
break;
|
||||
|
||||
fCurrentView->ConvertToScreenForDrawing(&rect);
|
||||
drawingEngine->DrawRoundRect(rect, xrad, yrad,
|
||||
float scale = fCurrentView->CurrentState()->CombinedScale();
|
||||
drawingEngine->DrawRoundRect(rect, xRadius * scale, yRadius * scale,
|
||||
code == AS_FILL_ROUNDRECT);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user