Skip to content

Commit

Permalink
gg: fix the alignment of the bottom border of draw_rounded_rect_empty…
Browse files Browse the repository at this point in the history
… on macos and linux
  • Loading branch information
spytheman committed Oct 12, 2023
1 parent e0e0987 commit 2af135d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vlib/gg/draw.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,11 @@ pub fn (ctx &Context) draw_rounded_rect_empty(x f32, y f32, w f32, h f32, radius
sgl.v2f(rtx + r, rty)
sgl.v2f(rtx + r, rby)
// bottom
sgl.v2f(lbx, lby + r - 1)
sgl.v2f(rbx, rby + r - 1)
// Note: test on native windows, macos, and linux if you need to change the offset literal here,
// with `v run vlib/gg/testdata/draw_rounded_rect_empty.vv` . Using 1 here, looks good on windows,
// and on linux with LIBGL_ALWAYS_SOFTWARE=true, but misaligned on native macos and linux.
sgl.v2f(lbx, lby + r - 0.5)
sgl.v2f(rbx, rby + r - 0.5)
// left
sgl.v2f(sx + 1, lty)
sgl.v2f(sx + 1, lby)
Expand Down

0 comments on commit 2af135d

Please sign in to comment.