gg: fix the alignment of the bottom border of draw_rounded_rect_empty on macos and linux

This commit is contained in:
Delyan Angelov 2023-10-13 01:36:57 +03:00
parent e0e0987117
commit 2af135d716
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -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)