Fixed clock and checkbox

This commit is contained in:
Sasha Koshka 2023-01-20 00:42:57 -05:00
parent 4367bba602
commit afd543ce92
2 changed files with 8 additions and 4 deletions

View File

@ -68,7 +68,7 @@ func (element *Checkbox) HandleMouseUp (x, y int, button tomo.Button) {
}
func (element *Checkbox) HandleMouseMove (x, y int) { }
func (element *Checkbox) HandleScroll (x, y int, deltaX, deltaY float64) { }
func (element *Checkbox) HandleMouseScroll (x, y int, deltaX, deltaY float64) { }
func (element *Checkbox) HandleKeyDown (
key tomo.Key,

View File

@ -34,7 +34,7 @@ func (element *AnalogClock) SetTime (newTime time.Time) {
element.time = newTime
if element.core.HasImage() {
element.draw()
element.core.PushAll()
element.core.DamageAll()
}
}
@ -67,11 +67,15 @@ func (element *AnalogClock) draw () {
0, 0.7, (second - 15) / 30 * math.Pi)
}
// MinimumHeightFor constrains the clock's minimum size to a 1:1 aspect ratio.
func (element *AnalogClock) MinimumHeightFor (width int) (height int) {
// FlexibleHeightFor constrains the clock's minimum size to a 1:1 aspect ratio.
func (element *AnalogClock) FlexibleHeightFor (width int) (height int) {
return width
}
// OnFlexibleHeightChange sets a function to be calle dwhen the parameters
// affecting the clock's flexible height change.
func (element *AnalogClock) OnFlexibleHeightChange (func ()) { }
func (element *AnalogClock) radialLine (
source artist.Pattern,
inner float64,