mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 19:31:30 +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;
|
||||
|
||||
let x = (d.screen_width - width) / 2;
|
||||
let y = (d.screen_height - height) / 2;
|
||||
let x = if d.screen_width > width { (d.screen_width - width) / 2 } else { 0 };
|
||||
let y = if d.screen_height > height { (d.screen_height - height) / 2 } else { 0 };
|
||||
|
||||
let handle = (d.lib.XCreateWindow)(
|
||||
d.display,
|
||||
|
|
Loading…
Reference in a new issue