mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
ui: Remove unneeded variable deviceScale
This commit is contained in:
parent
34d2e9a3fb
commit
0a911b28b2
@ -36,7 +36,6 @@ type userInterface struct {
|
|||||||
fullscreen bool
|
fullscreen bool
|
||||||
runnableInBackground bool
|
runnableInBackground bool
|
||||||
|
|
||||||
deviceScale float64
|
|
||||||
sizeChanged bool
|
sizeChanged bool
|
||||||
windowFocus bool
|
windowFocus bool
|
||||||
}
|
}
|
||||||
@ -116,7 +115,12 @@ func (u *userInterface) getScale() float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) actualScreenScale() float64 {
|
func (u *userInterface) actualScreenScale() float64 {
|
||||||
return u.getScale() * u.deviceScale
|
// CSS imageRendering property seems useful to enlarge the screen,
|
||||||
|
// but doesn't work in some cases (#306):
|
||||||
|
// * Chrome just after restoring the lost context
|
||||||
|
// * Safari
|
||||||
|
// Let's use the devicePixelRatio as it is here.
|
||||||
|
return u.getScale() * devicescale.DeviceScale()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) update(g GraphicsContext) error {
|
func (u *userInterface) update(g GraphicsContext) error {
|
||||||
@ -373,13 +377,6 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterface) updateScreenSize() {
|
func (u *userInterface) updateScreenSize() {
|
||||||
// CSS imageRendering seems useful to enlarge the screen,
|
|
||||||
// but doesn't work in some cases (#306):
|
|
||||||
// * Chrome just after restoring the lost context
|
|
||||||
// * Safari
|
|
||||||
// Let's use the pixel ratio as it is here.
|
|
||||||
u.deviceScale = devicescale.DeviceScale()
|
|
||||||
|
|
||||||
canvas.Set("width", int(float64(u.width)*u.actualScreenScale()))
|
canvas.Set("width", int(float64(u.width)*u.actualScreenScale()))
|
||||||
canvas.Set("height", int(float64(u.height)*u.actualScreenScale()))
|
canvas.Set("height", int(float64(u.height)*u.actualScreenScale()))
|
||||||
canvasStyle := canvas.Get("style")
|
canvasStyle := canvas.Get("style")
|
||||||
|
Loading…
Reference in New Issue
Block a user