mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
Rename RealScale -> ActualScale
This commit is contained in:
parent
96f5315c49
commit
8994bf4fad
@ -63,7 +63,7 @@ func init() {
|
|||||||
type UI struct {
|
type UI struct {
|
||||||
window *glfw.Window
|
window *glfw.Window
|
||||||
scale int
|
scale int
|
||||||
realScale int
|
actualScale int
|
||||||
glContext *opengl.Context
|
glContext *opengl.Context
|
||||||
input input
|
input input
|
||||||
funcs chan func()
|
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.
|
// For retina displays, recalculate the scale with the framebuffer size.
|
||||||
windowWidth, _ := window.GetFramebufferSize()
|
windowWidth, _ := window.GetFramebufferSize()
|
||||||
ui.realScale = windowWidth / width
|
ui.actualScale = windowWidth / width
|
||||||
|
|
||||||
return ui, err
|
return ui, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UI) RealScale() int {
|
func (u *UI) ActualScale() int {
|
||||||
return u.realScale
|
return u.actualScale
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UI) DoEvents() {
|
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
|
var graphicsContext *graphicsContext
|
||||||
ui.Use(func(c *opengl.Context) {
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user