Got scroll container working

This commit is contained in:
Sasha Koshka
2023-01-31 18:39:17 -05:00
parent 541d0f4204
commit 9b22e80f05
10 changed files with 52 additions and 42 deletions

View File

@@ -26,8 +26,8 @@ func NewArtist () (element *Artist) {
func (element *Artist) draw () {
bounds := element.Bounds()
element.cellBounds.Max.X = bounds.Dx() / 5
element.cellBounds.Max.Y = (bounds.Dy() - 48) / 8
element.cellBounds.Max.X = bounds.Min.X + bounds.Dx() / 5
element.cellBounds.Max.Y = bounds.Min.Y + (bounds.Dy() - 48) / 8
drawStart := time.Now()

View File

@@ -36,12 +36,12 @@ func (element *Mouse) draw () {
bounds)
artist.Line (
element, artist.NewUniform(color.White), 1,
image.Pt(1, 1),
image.Pt(bounds.Dx() - 2, bounds.Dy() - 2))
bounds.Min.Add(image.Pt(1, 1)),
bounds.Min.Add(image.Pt(bounds.Dx() - 2, bounds.Dy() - 2)))
artist.Line (
element, artist.NewUniform(color.White), 1,
image.Pt(1, bounds.Dy() - 2),
image.Pt(bounds.Dx() - 2, 1))
bounds.Min.Add(image.Pt(1, bounds.Dy() - 2)),
bounds.Min.Add(image.Pt(bounds.Dx() - 2, 1)))
}
func (element *Mouse) HandleMouseDown (x, y int, button tomo.Button) {