Skip to content

Commit d8ad1cf

Browse files
committed
fix(linux): fix negative margin calculation issue
1 parent b6a3fa3 commit d8ad1cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/linux/x11_api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl PlatformApi for X11Api {
128128
let Bgra([_, _, _, a]) = image.get_pixel(half_width, y);
129129
if a == 0xff {
130130
// the end of the transparent area
131-
margin.top = (y - 1) as u16;
131+
margin.top = y as u16;
132132
dbg!(margin.top);
133133
break;
134134
}
@@ -148,7 +148,7 @@ impl PlatformApi for X11Api {
148148
let Bgra([_, _, _, a]) = image.get_pixel(x, half_height);
149149
if a == 0xff {
150150
// the end of the transparent area
151-
margin.left = (x - 1) as u16;
151+
margin.left = x as u16;
152152
dbg!(margin.left);
153153
break;
154154
}

0 commit comments

Comments
 (0)