mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-24 03:41:29 +11:00
fix 'attempt to subtract with overflow' bug (#96)
* fix 'attempt to subtract with overflow' bug * Little mistake
This commit is contained in:
parent
24d2ce4a99
commit
5234be4283
|
@ -274,8 +274,8 @@ impl Window {
|
||||||
|
|
||||||
attributes.backing_store = xlib::NotUseful;
|
attributes.backing_store = xlib::NotUseful;
|
||||||
|
|
||||||
let x = (d.screen_width - width) / 2;
|
let x = if d.screen_width > width { (d.screen_width - width) / 2 } else { 0 };
|
||||||
let y = (d.screen_height - height) / 2;
|
let y = if d.screen_height > height { (d.screen_height - height) / 2 } else { 0 };
|
||||||
|
|
||||||
let handle = (d.lib.XCreateWindow)(
|
let handle = (d.lib.XCreateWindow)(
|
||||||
d.display,
|
d.display,
|
||||||
|
|
Loading…
Reference in a new issue