mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gg: ensure window_size does not do / 0 (#8907)
This commit is contained in:
@ -761,7 +761,10 @@ pub fn screen_size() Size {
|
|||||||
|
|
||||||
// window_size returns the `Size` of the active window
|
// window_size returns the `Size` of the active window
|
||||||
pub fn window_size() Size {
|
pub fn window_size() Size {
|
||||||
s := sapp.dpi_scale()
|
mut s := sapp.dpi_scale()
|
||||||
|
if s == 0 {
|
||||||
|
s = 1.
|
||||||
|
}
|
||||||
return Size{int(sapp.width() / s), int(sapp.height() / s)}
|
return Size{int(sapp.width() / s), int(sapp.height() / s)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user