Skip to content

Commit f36e46b

Browse files
author
kahsa
authored
gg:fix draw_line for android (#9882)
1 parent 9d68f92 commit f36e46b

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

vlib/gg/gg.v

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -560,17 +560,19 @@ pub fn (ctx &Context) draw_line(x f32, y f32, x2 f32, y2 f32, c gx.Color) {
560560
if c.a != 255 {
561561
sgl.load_pipeline(ctx.timage_pip)
562562
}
563-
if ctx.scale > 1 {
564-
// Make the line more clear on hi dpi screens: draw a rectangle
565-
mut width := mu.abs(x2 - x)
566-
mut height := mu.abs(y2 - y)
567-
if width == 0 {
568-
width = 1
569-
} else if height == 0 {
570-
height = 1
563+
$if !android {
564+
if ctx.scale > 1 {
565+
// Make the line more clear on hi dpi screens: draw a rectangle
566+
mut width := mu.abs(x2 - x)
567+
mut height := mu.abs(y2 - y)
568+
if width == 0 {
569+
width = 1
570+
} else if height == 0 {
571+
height = 1
572+
}
573+
ctx.draw_rect(x, y, width, height, c)
574+
return
571575
}
572-
ctx.draw_rect(x, y, width, height, c)
573-
return
574576
}
575577
sgl.c4b(c.r, c.g, c.b, c.a)
576578
sgl.begin_line_strip()

0 commit comments

Comments
 (0)