fix propagation from gui to stream threats
This commit is contained in:
parent
2d909f771d
commit
1ef2081c47
1 changed files with 14 additions and 4 deletions
18
src/main.rs
18
src/main.rs
|
@ -1230,12 +1230,12 @@ fn laser_mouse_moved(app: &App, model: &mut GuiModel, pos: Point2) {
|
|||
let point = config.filters.homography.move_dac_point(*map_idx, [laser_x, laser_y]);
|
||||
|
||||
// 3. update config in laser stream threat
|
||||
let mat = config.filters.homography.homography_matrix.clone();
|
||||
let homography = config.filters.homography.clone();
|
||||
|
||||
let selected_laser_stream = model.laser_streams.get(&dac_id);
|
||||
if let Some(stream) = selected_laser_stream {
|
||||
stream.send(move |laser_model: &mut LaserModel| {
|
||||
laser_model.config.filters.homography.homography_matrix = mat
|
||||
laser_model.config.filters.homography = homography
|
||||
}).unwrap();
|
||||
}
|
||||
|
||||
|
@ -1380,11 +1380,11 @@ fn map_mouse_moved(_app: &App, model: &mut GuiModel, pos: Point2) {
|
|||
|
||||
// 3. propagate to laser stream threat
|
||||
let selected_laser_stream = model.laser_streams.get(&dac_id);
|
||||
let mat = config.filters.homography.homography_matrix.clone();
|
||||
let homography = config.filters.homography.clone();
|
||||
|
||||
if let Some(stream) = selected_laser_stream {
|
||||
stream.send(move |laser_model: &mut LaserModel| {
|
||||
laser_model.config.filters.homography.homography_matrix = mat;
|
||||
laser_model.config.filters.homography = homography;
|
||||
}).unwrap();
|
||||
}
|
||||
|
||||
|
@ -1486,6 +1486,16 @@ fn map_mouse_pressed(app: &App, model: &mut GuiModel, button: MouseButton) {
|
|||
model.canvas_dragging_homography = Some(index);
|
||||
}
|
||||
}
|
||||
|
||||
// propagate to laser dac streamer
|
||||
let selected_laser_stream = model.laser_streams.get(&dac_id);
|
||||
let homography = config.filters.homography.clone();
|
||||
|
||||
if let Some(stream) = selected_laser_stream {
|
||||
stream.send(move |laser_model: &mut LaserModel| {
|
||||
laser_model.config.filters.homography = homography;
|
||||
}).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue