Changed the order of the Theme.Pattern method

This commit is contained in:
Sasha Koshka 2023-02-12 10:58:23 -05:00
parent 82e92f1e2e
commit 7f0462d588
3 changed files with 6 additions and 6 deletions

View File

@ -307,7 +307,7 @@ func (element *Piano) drawFlat (
) {
state.Pressed = pressed
pattern := element.theme.Theme.Pattern (
theme.PatternButton, theme.C("fun", "flatKey"), state)
theme.PatternButton, state, theme.C("fun", "flatKey"))
artist.FillRectangle(element, pattern, bounds)
}
@ -318,6 +318,6 @@ func (element *Piano) drawSharp (
) {
state.Pressed = pressed
pattern := element.theme.Theme.Pattern (
theme.PatternButton, theme.C("fun", "sharpKey"), state)
theme.PatternButton, state, theme.C("fun", "sharpKey"))
artist.FillRectangle(element, pattern, bounds)
}

View File

@ -24,7 +24,7 @@ func (Default) FontFace (style FontStyle, size FontSize, c Case) font.Face {
}
// Icon returns an icon from the default set corresponding to the given name.
func (Default) Icon (string, Case, IconSize) canvas.Image {
func (Default) Icon (string, IconSize, Case) canvas.Image {
// TODO
return nil
}
@ -33,8 +33,8 @@ func (Default) Icon (string, Case, IconSize) canvas.Image {
// pattern ID.
func (Default) Pattern (
pattern Pattern,
c Case,
state PatternState,
c Case,
) artist.Pattern {
switch pattern {
case PatternAccent:

View File

@ -66,7 +66,7 @@ type Theme interface {
// Pattern returns an appropriate pattern given a pattern name, case,
// and state.
Pattern (Pattern, Case, PatternState) artist.Pattern
Pattern (Pattern, PatternState, Case) artist.Pattern
// Inset returns the area on all sides of a given pattern that is not
// meant to be drawn on.
@ -101,7 +101,7 @@ func (wrapped Wrapped) Icon (name string, size IconSize) canvas.Image {
// Pattern returns an appropriate pattern given a pattern name and state.
func (wrapped Wrapped) Pattern (id Pattern, state PatternState) artist.Pattern {
real := wrapped.ensure()
return real.Pattern(id, wrapped.Case, state)
return real.Pattern(id, state, wrapped.Case)
}
// Inset returns the area on all sides of a given pattern that is not meant to