Skip to content

Commit

Permalink
Cleanup: Use binding with ForEach
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Jun 11, 2023
1 parent 49e5b61 commit fa7d51e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/PianoRoll/PianoRoll.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ public struct PianoRoll: View {
.foregroundColor(gridColor)
.contentShape(Rectangle())
.gesture(editable ? TapGesture().sequenced(before: dragGesture) : nil)
ForEach(model.notes) { note in
ForEach($model.notes) { $note in
switch layout {
case .horizontal:
PianoRollNoteView(
note: $model.notes[model.notes.firstIndex(of: note)!],
note: $note,
gridSize: gridSize,
color: noteColor,
sequenceLength: model.length,
Expand All @@ -100,7 +100,7 @@ public struct PianoRoll: View {

case .vertical:
VerticalPianoRollNoteView(
note: $model.notes[model.notes.firstIndex(of: note)!],
note: $note,
gridSize: gridSize,
color: noteColor,
sequenceLength: model.length,
Expand Down

0 comments on commit fa7d51e

Please sign in to comment.