Skip to content

Commit

Permalink
fix: drag waveform breaks delete waveform button issue
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelpswang authored and tomcl committed Sep 22, 2024
1 parent aaa47ba commit 51c7811
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Renderer/UI/WaveSim/WaveSimWaveforms.fs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ let nameRows (model: Model) (wsModel: WaveSimModel) dispatch: ReactElement list

)
OnMouseOut (fun _ ->
dispatch <| SetWSModel {wsModel with HoveredLabel = None}
dispatch <| SetWSModel {wsModel with HoveredLabel = None; DraggedIndex = None; PrevSelectedWaves = None }
dispatch <| Sheet (SheetT.Msg.Wire (BusWireT.Msg.Symbol (SymbolT.SelectSymbols [])))
dispatch <| Sheet (SheetT.Msg.UpdateSelectedWires (connsOfWave (Simulator.getFastSim()) wave, false))
)
Expand Down Expand Up @@ -146,7 +146,7 @@ let nameRows (model: Model) (wsModel: WaveSimModel) dispatch: ReactElement list
ev.dataTransfer.dropEffect <- "move"
let nameColEl = Browser.Dom.document.getElementById "namesColumn"
let bcr = nameColEl.getBoundingClientRect ()
let index = int (ev.clientY - bcr.top) / Constants.rowHeight - 1
let index = int (ev.clientY - bcr.top) / Constants.rowHeight - 1 |> max 0 |> min (List.length wsModel.SelectedWaves)
let draggedWave =
match wsModel.DraggedIndex with
| Some waveId -> [waveId]
Expand Down

0 comments on commit 51c7811

Please sign in to comment.