Fix thos issue

This commit is contained in:
Sasha Koshka 2023-02-14 02:14:52 -05:00
parent d18da8b07a
commit dcaf9919e4
2 changed files with 3 additions and 3 deletions

View File

@ -113,6 +113,7 @@ func (control CoreControl) HasImage () (has bool) {
// DamageRegion pushes the selected region of pixels to the parent element. This // DamageRegion pushes the selected region of pixels to the parent element. This
// does not need to be called when responding to a resize event. // does not need to be called when responding to a resize event.
func (control CoreControl) DamageRegion (bounds image.Rectangle) { func (control CoreControl) DamageRegion (bounds image.Rectangle) {
if control.core.canvas == nil { return }
if control.core.onDamage != nil { if control.core.onDamage != nil {
control.core.onDamage(canvas.Cut(control.core.canvas, bounds)) control.core.onDamage(canvas.Cut(control.core.canvas, bounds))
} }

View File

@ -61,7 +61,7 @@ func (element *AnalogClock) draw () {
state := theme.PatternState { } state := theme.PatternState { }
pattern := element.theme.Pattern(theme.PatternSunken, state) pattern := element.theme.Pattern(theme.PatternSunken, state)
inset := element.theme.Inset(theme.PatternSunken) inset := element.theme.Inset(theme.PatternSunken)
artist.FillRectangle(element, pattern, bounds) artist.FillRectangle(element.core, pattern, bounds)
bounds = inset.Apply(bounds) bounds = inset.Apply(bounds)
@ -107,6 +107,5 @@ func (element *AnalogClock) radialLine (
max := element.Bounds().Min.Add(image.Pt ( max := element.Bounds().Min.Add(image.Pt (
int(math.Cos(radian) * outer * width + width), int(math.Cos(radian) * outer * width + width),
int(math.Sin(radian) * outer * height + height))) int(math.Sin(radian) * outer * height + height)))
// println(min.String(), max.String()) artist.Line(element.core, source, 1, min, max)
artist.Line(element, source, 1, min, max)
} }