mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 02:35:37 +01:00
Deliver Option as a modifier-change event in Zoom regression
This commit is contained in:
1 parent
8cd5376786
commit
c8abbce26b
1 file changed
+3
-7
@@ -9,12 +9,7 @@ use vectorcraft_geom::Point;
|
||||
|
||||
/// One headless canvas frame on an 800 × 600 window.
|
||||
fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<egui::Event>) {
|
||||
frame_with_modifiers(app, ctx, events, Default::default());
|
||||
}
|
||||
|
||||
fn frame_with_modifiers(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<egui::Event>, modifiers: egui::Modifiers) {
|
||||
let raw =
|
||||
egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, modifiers, ..Default::default() };
|
||||
let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, ..Default::default() };
|
||||
let mut out = ctx.run_ui(raw, |ui| show(app, ui));
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
@@ -186,8 +181,9 @@ fn selected_zoom_tool_clicks_option_clicks_and_drags_a_marquee() {
|
||||
let modifiers = egui::Modifiers::ALT;
|
||||
for pressed in [true, false] {
|
||||
let event = egui::Event::PointerButton { pos: position, button: egui::PointerButton::Primary, pressed, modifiers };
|
||||
frame_with_modifiers(&mut app, &ctx, vec![event], modifiers);
|
||||
frame(&mut app, &ctx, vec![egui::Event::ModifiersChanged(modifiers), event]);
|
||||
}
|
||||
frame(&mut app, &ctx, vec![egui::Event::ModifiersChanged(egui::Modifiers::NONE)]);
|
||||
let reduced = zoom(&app);
|
||||
assert!(reduced < enlarged, "Option-click should zoom out: {enlarged} -> {reduced}");
|
||||
let start = position - vec2(90.0, 65.0);
|
||||
|
||||
Reference in new issue
Block a user