aboutsummaryrefslogtreecommitdiff
path: root/src/fw
diff options
context:
space:
mode:
authoriamcheeseman <[hidden email]>2026-02-06 22:37:46 -0500
committeriamcheeseman <[hidden email]>2026-02-06 22:37:46 -0500
commitc6261cc09f97568ad5ea966662697e01ea17b861 (patch)
treeffa589bccffc5d81c0568e8a044382105ead79f1 /src/fw
parentabef713d32b1e237edd718999e47997f5a2a1bcb (diff)
round draw positions
Diffstat (limited to 'src/fw')
-rw-r--r--src/fw/renderer.odin8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fw/renderer.odin b/src/fw/renderer.odin
index e8b34fe..149eff6 100644
--- a/src/fw/renderer.odin
+++ b/src/fw/renderer.odin
@@ -220,6 +220,9 @@ draw_line :: proc(
start_idx := Index(len(renderer.draw_call.vertices))
+ start := linalg.round(start)
+ end := linalg.round(end)
+
_add_vertex(Vertex{{start.x, start.y, depth}, {0.5, 0.5}, color})
_add_vertex(Vertex{{end.x, end.y, depth}, {0.5, 0.5}, color})
@@ -251,6 +254,7 @@ draw_rect_gradient :: proc(
}
pos := linalg.round(pos)
+ size := linalg.round(size)
tl := Vertex{{pos.x, pos.y, depth}, {0, 0}, tl_color}
tr := Vertex{{pos.x + size.x, pos.y, depth}, {1, 0}, tr_color}
@@ -384,6 +388,10 @@ draw_tile :: proc(
color := Color{1, 1, 1, 1}
) {
pos := linalg.round(pos)
+ rect := Rect{
+ start = linalg.round(rect.start),
+ size = linalg.round(rect.size),
+ }
tex_size := Vec2{f32(tex.size.x), f32(tex.size.y)}