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