Skip to content

Commit

Permalink
Update pntr.h
Browse files Browse the repository at this point in the history
Co-authored-by: Rob Loach <[email protected]>
  • Loading branch information
konsumer and RobLoach authored Jan 20, 2025
1 parent ff1bddd commit 12bea5c
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions pntr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2212,21 +2212,9 @@ PNTR_API void pntr_draw_line_vertical(pntr_image* dst, int posX, int posY, int h
}

PNTR_API void pntr_draw_line_vertical_thick(pntr_image* dst, int posX, int posY, int height, int thickness, pntr_color color) {
if (color.rgba.a == 0 || dst == NULL || posX < dst->clip.x || posX >= dst->clip.x + dst->clip.width || posY >= dst->clip.y + dst->clip.height || posY + height < dst->clip.y) {
return;
}

if (posY < dst->clip.y) {
height += posY - dst->clip.y;
posY = dst->clip.y;
}
if (posY + height >= dst->clip.y + dst->clip.height) {
height = dst->clip.y + dst->clip.height - posY;
}

for (int y = 0; y < height; y++) {
pntr_draw_circle_fill(dst, posX, y, thickness/2, color);
}
pntr_draw_rectangle_fill(dst, posX - thickness / 2, posY, thickness, height, color);
pntr_draw_circle_fill(dst, posX, posY, thickness / 2, color);
pntr_draw_circle_fill(dst, posX, posY + height, thickness / 2, color);
}

/**
Expand Down

0 comments on commit 12bea5c

Please sign in to comment.