Skip to content

Commit

Permalink
Update custom draw procs for latest koi
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnovak committed Mar 20, 2024
1 parent 841afbf commit b508877
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3407,7 +3407,7 @@ proc colorRadioButtonDrawProc(colors: seq[Color],
const SelPad = 3

var cx, cy, cw, ch: float
if state in {wsDown, wsActive, wsActiveHover, wsHover}:
if state in {wsHover, wsDown, wsActive, wsActiveHover, wsActiveDown}:
vg.beginPath()
vg.strokeColor(cursorColor)
vg.strokeWidth(sw)
Expand Down Expand Up @@ -7663,18 +7663,19 @@ proc specialWallDrawProc(lt: LevelTheme,
state: WidgetState, style: RadioButtonsStyle) =

var (bgCol, active) = case state
of wsActive: (lt.cursorColor, true)
of wsHover: (tt.buttonHoverColor, false)
of wsActiveHover: (lt.cursorColor, true)
of wsDown: (lt.cursorColor, true)
else: (tt.buttonNormalColor, false)
of wsHover:
(tt.buttonHoverColor, false)
of wsDown, wsActive, wsActiveHover, wsActiveDown:
(lt.cursorColor, true)
else:
(tt.buttonNormalColor, false)

# Nasty stuff, but it's not really worth refactoring everything for
# this little aesthetic fix...
let
savedFloorColor = lt.floorBackgroundColor[0]
savedForegroundNormalNormalColor = lt.foregroundNormalNormalColor
savedForegroundLightNormalColor = lt.foregroundLightNormalColor
savedForegroundLightNormalColor = lt.foregroundLightNormalColor
savedBackgroundImage = dp.backgroundImage

lt.floorBackgroundColor[0] = lerp(lt.backgroundColor, bgCol, bgCol.a)
Expand Down

0 comments on commit b508877

Please sign in to comment.