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

@@ -134,7 +134,7 @@ func (element *Checkbox) SetText (text string) {
func (element *Checkbox) draw () {
bounds := element.Bounds()
boxBounds := image.Rect(0, 0, bounds.Dy(), bounds.Dy())
boxBounds := image.Rect(0, 0, bounds.Dy(), bounds.Dy()).Add(bounds.Min)
backgroundPattern, _ := theme.BackgroundPattern(theme.PatternState {
Case: checkboxCase,
@@ -150,9 +150,9 @@ func (element *Checkbox) draw () {
artist.FillRectangle(element, pattern, boxBounds)
textBounds := element.drawer.LayoutBounds()
offset := image.Point {
offset := bounds.Min.Add(image.Point {
X: bounds.Dy() + theme.Padding(),
}
})
offset.Y -= textBounds.Min.Y
offset.X -= textBounds.Min.X