gg: fix draw_line on m1

pull/10394/head
Delyan Angelov 2021-06-07 21:31:24 +03:00
parent 5b2046342b
commit 98613036c1
1 changed files with 2 additions and 3 deletions

View File

@ -9,7 +9,6 @@ import sokol.sapp
import sokol.sgl
import sokol.gfx
import math
import math.mathutil as mu
// import time
pub type FNCb = fn (x voidptr)
@ -569,8 +568,8 @@ pub fn (ctx &Context) draw_line(x f32, y f32, x2 f32, y2 f32, c gx.Color) {
$if !android {
if ctx.scale > 1 {
// Make the line more clear on hi dpi screens: draw a rectangle
mut width := mu.abs(x2 - x)
mut height := mu.abs(y2 - y)
mut width := (x2 - x)
mut height := (y2 - y)
if width == 0 {
width = 1
} else if height == 0 {