mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
ui: Fix deviceScale for mobiles
This commit is contained in:
parent
b0a7e13502
commit
989ae1ebc5
@ -14,6 +14,6 @@
|
||||
|
||||
package ui
|
||||
|
||||
func deviceScale() int {
|
||||
func deviceScale() float64 {
|
||||
return 1
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ package ui
|
||||
// }
|
||||
import "C"
|
||||
|
||||
func deviceScale() int {
|
||||
return int(C.devicePixelRatio())
|
||||
func deviceScale() float64 {
|
||||
return float64(C.devicePixelRatio())
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
// +build !js
|
||||
// +build !android
|
||||
|
||||
package ui
|
||||
|
||||
|
@ -145,7 +145,7 @@ func (u *userInterface) ScreenScale() int {
|
||||
}
|
||||
|
||||
func (u *userInterface) actualScreenScale() int {
|
||||
return u.scale * deviceScale()
|
||||
return u.scale * int(deviceScale())
|
||||
}
|
||||
|
||||
func UpdateTouches(touches []Touch) {
|
||||
|
Loading…
Reference in New Issue
Block a user