mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-10 12:22:22 +00:00
Tests: document the Color Sampler tests updated for pixel centres
This commit is contained in:
1 parent
010fbe9e2e
commit
e2580ccdb5
2 files changed
+10
No files matched your search
@@ -723,6 +723,8 @@ fn moving_an_artboard_left_of_or_above_the_origin_grows_the_canvas_there() {
|
||||
}
|
||||
}
|
||||
|
||||
/// Moving or making a board past the canvas origin re-bases the document; the Color Sampler
|
||||
/// points and the painting symmetry shift with it and stay on the same pixels.
|
||||
#[test]
|
||||
fn a_board_past_the_origin_moves_the_color_samplers_and_symmetry_with_the_document() {
|
||||
// #9302: the re-based document moved everything but the Color Sampler points and the
|
||||
@@ -778,6 +780,8 @@ fn a_board_past_the_origin_moves_the_color_samplers_and_symmetry_with_the_docume
|
||||
assert_eq!(samplers(&s), vec![[f64::from(by) + 5.5, 5.5]]);
|
||||
}
|
||||
|
||||
/// Duplicating a board whose document has boards past the origin (one or several selected
|
||||
/// layers) re-bases it; the Color Sampler points shift with the document.
|
||||
#[test]
|
||||
fn duplicating_a_board_beside_one_past_the_origin_moves_the_color_samplers_with_the_document() {
|
||||
// #9302 review: Layer › Duplicate puts the copy right of its board, but `fit_canvas` still
|
||||
|
||||
@@ -98,6 +98,8 @@ fn right_click_off_a_sampler_greys_every_row() {
|
||||
assert_eq!(samplers(&app).len(), 2, "nothing deleted, no sampler placed");
|
||||
}
|
||||
|
||||
/// The right-click menu's Delete removes the sampler under the pointer, closes the menu, and
|
||||
/// the samplers after it move up a number.
|
||||
#[test]
|
||||
fn delete_removes_the_sampler_under_the_pointer_and_renumbers_the_rest() {
|
||||
let (mut app, ctx) = app();
|
||||
@@ -112,6 +114,8 @@ fn delete_removes_the_sampler_under_the_pointer_and_renumbers_the_rest() {
|
||||
assert_eq!(listed["samplers"][1]["number"], json!(2));
|
||||
}
|
||||
|
||||
/// Delete never removes a different sampler when the list changes while the menu is open: one
|
||||
/// deleted or moved meanwhile, or another document with a sampler at the same index and spot.
|
||||
#[test]
|
||||
fn delete_never_removes_another_sampler_after_the_list_changes_under_the_menu() {
|
||||
let (mut app, ctx) = app();
|
||||
@@ -150,6 +154,8 @@ fn readout_rows_do_nothing_until_samplers_have_readout_modes() {
|
||||
assert_eq!(samplers(&app).len(), 2);
|
||||
}
|
||||
|
||||
/// A sampler gone while the menu is open, a non-finite point, or no document at all: Delete
|
||||
/// greys out and nothing panics.
|
||||
#[test]
|
||||
fn a_stale_sampler_or_odd_point_fails_gracefully() {
|
||||
let (mut app, ctx) = app();
|
||||
|
||||
Reference in new issue
Block a user