Window resizing
This commit is contained in:
parent
fa72865465
commit
e12fb3d7db
@ -114,13 +114,13 @@ func (backend *Backend) Resized () (resized bool) {
|
||||
}
|
||||
|
||||
func (backend *Backend) draw () {
|
||||
didDrawing := false
|
||||
// didDrawing := false
|
||||
|
||||
if backend.boundsDirty {
|
||||
backend.window.Clear (
|
||||
backend.config.Color(stone.ColorApplication))
|
||||
backend.boundsDirty = false
|
||||
didDrawing = true
|
||||
// didDrawing = true
|
||||
} else {
|
||||
// TODO: clear out dirty cells before drawing them (we don't
|
||||
// want to clear them out if we have already just cleared
|
||||
@ -138,19 +138,26 @@ func (backend *Backend) draw () {
|
||||
if clean { continue }
|
||||
|
||||
// draw cell
|
||||
cell := backend.application.Cell(x, y)
|
||||
content := cell.Rune()
|
||||
if content < 32 { continue }
|
||||
|
||||
didDrawing = true // TODO: set didDrawing up there ^
|
||||
// didDrawing = true // TODO: set didDrawing up there ^
|
||||
backend.application.MarkClean(x, y)
|
||||
}
|
||||
}
|
||||
|
||||
if didDrawing {
|
||||
backend.window.SwapBuffers()
|
||||
}
|
||||
backend.window.SwapBuffers()
|
||||
}
|
||||
|
||||
func (backend *Backend) processEvents () {
|
||||
newBounds := backend.window.Bounds().Max
|
||||
backend.boundsDirty = backend.previousBounds != newBounds
|
||||
backend.previousBounds = newBounds
|
||||
|
||||
if backend.boundsDirty {
|
||||
// TODO: set size of buffer
|
||||
}
|
||||
}
|
||||
|
||||
func (backend *Backend) calculateWindowSize () (bounds pixel.Rect) {
|
||||
|
Loading…
Reference in New Issue
Block a user