mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-11 16:30:12 -06:00
fix: 修复 PR #1457 的选择与拖拽评审问题
- 标签在选择边界外也参与收窄,Dev Mode 单击已选图层只选它 - 区分点击命中图层与描边空白处的拖拽回退目标 - 重排圆环按按下时的修饰键判断点击,画布外松手视为拖拽结束 - 修复 clippy unnecessary_get_then_check
This commit is contained in:
@@ -456,6 +456,21 @@ fn a_layer_stacked_below_the_selection_doesnt_take_a_drag_from_inside_it() {
|
||||
assert_eq!(at(&s, gap), Point::new(home.x + 10.0, home.y + 10.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_click_where_nothing_is_hit_inside_a_multiple_selection_keeps_it() {
|
||||
let mut s = Session::new();
|
||||
let a = rect(&mut s, 100.0, 300.0, None);
|
||||
let b = rect(&mut s, 220.0, 300.0, None);
|
||||
for i in [a, b] {
|
||||
ex(&mut s, "node.set", json!({"ids": [i], "props": {"fills": [], "strokes": ["#000000"], "strokeWeight": 1}}));
|
||||
}
|
||||
ex(&mut s, "select.set", json!({"ids": [a, b]}));
|
||||
// The press is inside `a` but its unfilled inside hits nothing: `a` is only the drag fallback,
|
||||
// not a clicked layer, so a click keeps the selection.
|
||||
click(&mut s, 120.0, 320.0, NONE);
|
||||
assert_eq!(sorted(s.selection()), sorted(vec![a, b]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn alt_shift_drag_on_a_selected_layer_duplicates_it() {
|
||||
let mut s = Session::new();
|
||||
|
||||
Reference in New Issue
Block a user