Rename RealScale -> ActualScale

This commit is contained in:
Hajime Hoshi 2015-01-02 02:23:47 +09:00
parent 96f5315c49
commit 8994bf4fad
2 changed files with 10 additions and 10 deletions

View File

@ -61,12 +61,12 @@ 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()
} }
func New(width, height, scale int, title string) (*UI, error) { func New(width, height, scale int, title string) (*UI, error) {
@ -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
View File

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