Skip to content

Commit

Permalink
[FMX Render] Avoid draw empty round rect
Browse files Browse the repository at this point in the history
Co-Authored-By: Paulo César Botelho Barbosa <16469061+paulocesarbot@users.noreply.github.com>
  • Loading branch information
viniciusfbb and paulocesarbot committed Dec 7, 2024
1 parent d630212 commit 78c847e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/FMX/FMX.Skia.Canvas.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,8 @@ procedure TSkCanvasCustom.DoDrawRoundRect(const ARect: TRectF; const XRadius, YR
LRoundRect: ISkRoundRect;
LRoundRectRadii: TSkRoundRectRadii;
begin
if IsZero(ARect.Width) or IsZero(ARect.Height) then
Exit;
if (ACornerType <> TCornerType.Round) or
(not InRange(XRadius, 0, ARect.Width / 2)) or (not InRange(YRadius, 0, ARect.Height / 2)) then
begin
Expand Down Expand Up @@ -2196,6 +2198,8 @@ procedure TSkCanvasCustom.DoFillRoundRect(const ARect: TRectF; const XRadius, YR
LRoundRect: ISkRoundRect;
LRoundRectRadii: TSkRoundRectRadii;
begin
if IsZero(ARect.Width) or IsZero(ARect.Height) then
Exit;
if (ACornerType <> TCornerType.Round) or
(not InRange(XRadius, 0, ARect.Width / 2)) or (not InRange(YRadius, 0, ARect.Height / 2)) then
begin
Expand Down

0 comments on commit 78c847e

Please sign in to comment.