mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
Rename RealScale -> ActualScale
This commit is contained in:
parent
96f5315c49
commit
8994bf4fad
@ -63,7 +63,7 @@ func init() {
|
||||
type UI struct {
|
||||
window *glfw.Window
|
||||
scale int
|
||||
realScale int
|
||||
actualScale int
|
||||
glContext *opengl.Context
|
||||
input input
|
||||
funcs chan func()
|
||||
@ -109,13 +109,13 @@ func New(width, height, scale int, title string) (*UI, error) {
|
||||
|
||||
// For retina displays, recalculate the scale with the framebuffer size.
|
||||
windowWidth, _ := window.GetFramebufferSize()
|
||||
ui.realScale = windowWidth / width
|
||||
ui.actualScale = windowWidth / width
|
||||
|
||||
return ui, err
|
||||
}
|
||||
|
||||
func (u *UI) RealScale() int {
|
||||
return u.realScale
|
||||
func (u *UI) ActualScale() int {
|
||||
return u.actualScale
|
||||
}
|
||||
|
||||
func (u *UI) DoEvents() {
|
||||
|
2
run.go
2
run.go
@ -38,7 +38,7 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
|
||||
|
||||
var graphicsContext *graphicsContext
|
||||
ui.Use(func(c *opengl.Context) {
|
||||
graphicsContext, err = newGraphicsContext(c, width, height, ui.RealScale())
|
||||
graphicsContext, err = newGraphicsContext(c, width, height, ui.ActualScale())
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user