Skip to content

Commit

Permalink
Updates examples with a more concise match for MouseEvent.Click
Browse files Browse the repository at this point in the history
  • Loading branch information
hobnob committed Jul 24, 2023
1 parent eae070c commit 289eb79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object SubSystemsExample extends IndigoDemo[Unit, Unit, Unit, Unit] {
Outcome(())

def updateModel(context: FrameContext[Unit], model: Unit): GlobalEvent => Outcome[Unit] = {
case e @ MouseEvent.Click(_, _, _, _, _, _, _, _) =>
case e: MouseEvent.Click =>
Outcome(())
.addGlobalEvents(
PointsTrackerEvent.Add(10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object TextExample extends IndigoSandbox[Unit, Model] {
Material.ImageEffects(fontName).withTint(model.tint)
).alignRight
.onEvent {
case (txt, MouseEvent.Click(pt, _, _, _, _, _, _, _)) if context.bounds(txt).contains(pt) =>
case (txt, e: MouseEvent.Click) if context.bounds(txt).contains(e.position) =>
ChangeColour
}
)
Expand Down

0 comments on commit 289eb79

Please sign in to comment.