1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: radius_to_segments() should use Context.scale (#15906)

This commit is contained in:
Tim Marston 2022-09-28 08:40:40 +01:00 committed by GitHub
parent b85a535bcd
commit 66249b8c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -515,7 +515,7 @@ pub fn (ctx &Context) draw_circle_empty(x f32, y f32, radius f32, c gx.Color) {
mut theta := f32(0)
mut xx := f32(0)
mut yy := f32(0)
segments := radius_to_segments(radius)
segments := radius_to_segments(radius * ctx.scale)
sgl.begin_line_strip()
for i := 0; i < segments + 1; i++ {
@ -539,7 +539,7 @@ pub fn (ctx &Context) draw_circle_filled(x f32, y f32, radius f32, c gx.Color) {
return
}
}
ctx.draw_polygon_filled(x, y, radius, radius_to_segments(radius), 0, c)
ctx.draw_polygon_filled(x, y, radius, radius_to_segments(radius * ctx.scale), 0, c)
}
// draw_polygon_filled draws a filled polygon.