mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-31 21:27:00 -06:00
G1: Grid tool dialogs add reference point locator (#1377)
Rectangular and Polar Grid click dialogs show the nine-point locator and resize width/height about it using the same artboard_rect logic as Artboard Options. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
bflatastic
co-authored by
Cursor
parent
059b6d083c
commit
699e6e9af4
@@ -159,6 +159,20 @@ fn key_frame(app: &mut VectorcraftApp, key: egui::Key) {
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
|
||||
/// #1377: OK uses the bounding box after a reference-point resize (`artboard_rect` keeps the
|
||||
/// center pinned when width doubles).
|
||||
#[test]
|
||||
fn rectangular_grid_reference_point_pins_center_when_width_changes() {
|
||||
let mut app = app();
|
||||
click(&mut app, Point::new(100.0, 100.0));
|
||||
assert_eq!(field(&app, "reference"), json!(0));
|
||||
for (key, value) in [("reference", json!(4)), ("x", json!(50.0)), ("y", json!(50.0)), ("width", json!(200)), ("height", json!(100))] {
|
||||
set(&mut app, key, value);
|
||||
}
|
||||
let id = confirm(&mut app);
|
||||
assert_grid(&app, id, Rect::new(50.0, 50.0, 250.0, 150.0), 5, 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rectangular_grid_canvas_click_opens_registered_dialog_with_saved_counts_and_point_defaults() {
|
||||
let mut app = app();
|
||||
|
||||
Reference in New Issue
Block a user