System/Libraries/Graphics2D: Bounds check for HLine2D
This commit is contained in:
parent
108c1994b2
commit
1cc118da6f
1 changed files with 2 additions and 0 deletions
|
@ -726,6 +726,8 @@ U0 VLine2D(Context2D* ctx, I64 x, I64 y, I64 y2,
|
||||||
U0 HLine2D(Context2D* ctx, I64 x, I64 y, I64 x2,
|
U0 HLine2D(Context2D* ctx, I64 x, I64 y, I64 x2,
|
||||||
U32 color)
|
U32 color)
|
||||||
{ // Draw a horizontal line.
|
{ // Draw a horizontal line.
|
||||||
|
if (x > ctx->width || y > ctx->height)
|
||||||
|
return;
|
||||||
if (x2 < x)
|
if (x2 < x)
|
||||||
return;
|
return;
|
||||||
I64 width = x2 - x;
|
I64 width = x2 - x;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue