Button takes advantage of the rendering hints

This commit is contained in:
2023-02-16 22:41:07 -05:00
parent f8240fb518
commit 0c39c2dd57
3 changed files with 70 additions and 28 deletions

View File

@@ -137,6 +137,14 @@ func (wrapped Wrapped) Sink (id Pattern) image.Point {
return real.Sink(id, wrapped.Case)
}
// Hints returns rendering optimization hints for a particular pattern.
// These are optional, but following them may result in improved
// performance.
func (wrapped Wrapped) Hints (id Pattern) Hints {
real := wrapped.ensure()
return real.Hints(id, wrapped.Case)
}
func (wrapped Wrapped) ensure () (real Theme) {
real = wrapped.Theme
if real == nil { real = Default { } }