fix: not switching on plate type
Gitea Scan/plate-tool/pipeline/head This commit looks good
Details
Gitea Scan/plate-tool/pipeline/head This commit looks good
Details
me when i migrate correctly the first time and have no lingering bugs
This commit is contained in:
parent
72d81439c1
commit
6cfa686b55
|
@ -83,7 +83,7 @@ pub fn Plate(props: &PlateProps) -> Html {
|
|||
let mouseup_callback = {
|
||||
let m_start_handle = m_start_handle.clone();
|
||||
let m_end_handle = m_end_handle.clone();
|
||||
plate_callbacks::mouseup_callback(m_start_handle, m_end_handle, m_stat_handle, ct_dispatch)
|
||||
plate_callbacks::mouseup_callback(m_start_handle, m_end_handle, m_stat_handle, ct_dispatch, props.ptype)
|
||||
};
|
||||
|
||||
let mouseleave_callback = Callback::clone(&mouseup_callback);
|
||||
|
|
|
@ -3,6 +3,7 @@ use yewdux::prelude::*;
|
|||
|
||||
use crate::components::states::CurrentTransfer;
|
||||
use plate_tool_lib::transfer_region::Region;
|
||||
use plate_tool_lib::plate::PlateType;
|
||||
|
||||
// Color Palette for the Source Plates, can be changed here
|
||||
|
||||
|
@ -34,6 +35,7 @@ pub fn mouseup_callback(
|
|||
m_end_handle: MEndHandle,
|
||||
m_stat_handle: MStatHandle,
|
||||
ct_dispatch: Dispatch<CurrentTransfer>,
|
||||
ptype: PlateType,
|
||||
) -> Callback<MouseEvent> {
|
||||
Callback::from(move |_: MouseEvent| {
|
||||
m_stat_handle.set(false);
|
||||
|
@ -41,7 +43,10 @@ pub fn mouseup_callback(
|
|||
if let Some(br) = *m_end_handle {
|
||||
if let Ok(rd) = RegionDisplay::try_from((ul.0, ul.1, br.0, br.1)) {
|
||||
ct_dispatch.reduce_mut(|state| {
|
||||
state.transfer.transfer_region.source_region = Region::from(&rd);
|
||||
match ptype {
|
||||
PlateType::Source => state.transfer.transfer_region.source_region = Region::from(&rd),
|
||||
PlateType::Destination => state.transfer.transfer_region.dest_region = Region::from(&rd)
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue