Refactoring

This commit is contained in:
Hajime Hoshi 2018-05-12 02:29:39 +09:00
parent 453921f1d3
commit 3ccfe087d9
2 changed files with 2 additions and 4 deletions

View File

@ -95,7 +95,6 @@ func (f *framebuffer) projectionMatrix() []float32 {
return f.proMatrix return f.proMatrix
} }
w, h := f.viewportSize() w, h := f.viewportSize()
m := orthoProjectionMatrix(0, w, 0, h) f.proMatrix = orthoProjectionMatrix(0, w, 0, h)
f.proMatrix = m
return f.proMatrix return f.proMatrix
} }

View File

@ -161,12 +161,11 @@ func RunMainThreadLoop(ch <-chan error) error {
} }
func (u *userInterface) updateGraphicsContext(g GraphicsContext) { func (u *userInterface) updateGraphicsContext(g GraphicsContext) {
sizeChanged := false
width, height := 0, 0 width, height := 0, 0
actualScale := 0.0 actualScale := 0.0
u.m.Lock() u.m.Lock()
sizeChanged = u.sizeChanged sizeChanged := u.sizeChanged
if sizeChanged { if sizeChanged {
width = u.width width = u.width
height = u.height height = u.height