This repository has been archived on 2022-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
spectator/exhibit/block.go
Kevin Cotugno a73e0f6a27 ListWidget is Rendering Again
The ListWidget rendering has been updated to support the new
architecture.
1. Borders/Styles
2. golang Image package
3. Blocks
2017-12-30 02:23:20 -08:00

28 lines
483 B
Go

package exhibit
import (
"image"
)
type Block struct {
Rect image.Rectangle
Cells map[image.Point]Cell
}
func NewBlock(originx, originy, sizex, sizey int) Block {
b := Block{}
b.Rect = image.Rect(originx, originy, originx+sizex, originy+sizey)
b.Cells = make(map[image.Point]Cell)
return b
}
func (b *Block) SetSize(p image.Point) {
dx := b.Rect.Min.X
dy := b.Rect.Min.Y
b.Rect.Max.X = p.X + dx
b.Rect.Max.Y = p.Y + dy
}
func (b *Block) SetOrigin(p image.Point) {
}