Fix drag issue

These few lines of code are going to plague this project.
Transiently, this solution doesn't seem fast enough and
will "forget" that the mouse button is being held during
a drag.
I'm using mouseenter instead of mouseover because it
should trigger less often---this ought to be more efficient(?).
This commit is contained in:
Emilia Allison 2023-05-20 22:51:32 -04:00
parent e0563d7b9b
commit 67738543cc
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 4 additions and 1 deletions

View File

@ -68,7 +68,10 @@ fn SourcePlateCell(cx: Scope<PlateCellProps>, i: u8, j: u8, color: Option<String
selection_state.write().m_end = None;
selection_state.write().m_stat = true;
},
onmouseover: move |_| {
onmouseenter: move |me: MouseEvent| {
if me.data.held_buttons().is_empty() {
selection_state.write().m_stat = false;
}
if selection_state.read().m_stat {
selection_state.write().m_end = Some((*i,*j))
}