mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
ui: Bug fix: Don't use integer scale (JavaScript)
This commit is contained in:
parent
76f694b948
commit
193c03ea58
@ -294,13 +294,13 @@ func (u *userInterface) Start(width, height int, scale float64, title string) er
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) size() (width, height int) {
|
func (u *userInterface) size() (width, height int) {
|
||||||
a := int(u.ActualScreenScale())
|
a := u.ActualScreenScale()
|
||||||
if a == 0 {
|
if a == 0 {
|
||||||
// a == 0 only on the initial state.
|
// a == 0 only on the initial state.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
width = canvas.Get("width").Int() / a
|
width = int(canvas.Get("width").Float() / a)
|
||||||
height = canvas.Get("height").Int() / a
|
height = int(canvas.Get("height").Float() / a)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user