Summary Files Commits Branches @commit @diff @stats
path: root / FrameRender
diff options
context:
space:
mode:
Commit2f49c471e32bcf3d942b3396eb954a8dac0db4c7 (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-03-29 09:59:21 +0300
Committer
 Syndamia <kamen@syndamia.com>
2026-03-29 09:59:21 +0300
Files105145a83be15f1adb4ba3336febfe89a625ea2e /FrameRender
ppm_graphics-2f49c471e32bcf3d942b3396eb954a8dac0db4c7.tar
ppm_graphics-2f49c471e32bcf3d942b3396eb954a8dac0db4c7.tar.gz
ppm_graphics-2f49c471e32bcf3d942b3396eb954a8dac0db4c7.zip
Parentddd9c909a68ab0b28fa6707a9c4d6f92c78f22f9 (diff)
fix(P_LineSegment): Proplery center line segment
1 files changed, 2 insertions, 2 deletions
-rw-r--r--FrameRender/P_LineSegment.c4
diff --git a/FrameRender/P_LineSegment.c b/FrameRender/P_LineSegment.c
index f2236ff..02f7049 100644
--- a/FrameRender/P_LineSegment.c
+++ b/FrameRender/P_LineSegment.c
@@ -26,8 +26,8 @@ void LineSegment_callback(LineSegment* self, struct PixelContext* fc) {
rotatePoint(&y, &x, -phi);
rotatePoint(&bY, &bX, -phi);
- if (0 <= x && x <= bX &&
- -(i32)self->width / 2 <= y && y <= self->width / 2)
+ i32 halfWidth = self->width / 2;
+ if (0 <= x && x <= bX && -halfWidth <= y && y <= halfWidth)
{
ARGB_merge(&fc->pixel, self->color);
}