ui: Fix deviceScale for mobiles

This commit is contained in:
Hajime Hoshi 2016-06-19 05:14:02 +09:00
parent b0a7e13502
commit 989ae1ebc5
4 changed files with 5 additions and 4 deletions

View File

@ -14,6 +14,6 @@
package ui package ui
func deviceScale() int { func deviceScale() float64 {
return 1 return 1
} }

View File

@ -26,6 +26,6 @@ package ui
// } // }
import "C" import "C"
func deviceScale() int { func deviceScale() float64 {
return int(C.devicePixelRatio()) return float64(C.devicePixelRatio())
} }

View File

@ -13,6 +13,7 @@
// limitations under the License. // limitations under the License.
// +build !js // +build !js
// +build !android
package ui package ui

View File

@ -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) {