mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Canvas: a new working CMYK space renders a Working CMYK proof again
A proof of the working CMYK space converts through the working color settings. With a profile assigned to the document in place of the working CMYK space, Edit › Color Settings changes the working settings while the active settings stay the same, and the canvas kept showing the proof through the previous working space. - The canvas's frame key also holds the working color settings (`cms::working_settings`). - The test now requires a re-render after `edit.assignProfile`, and checks that a new working CMYK space re-renders a Working CMYK proof while the active settings stay the same.
This commit is contained in:
1 parent
76127a13b6
commit
15b4898f85
3 files changed
+24
-7
No files matched your search
@@ -225,11 +225,14 @@ pub struct CacheKey {
|
||||
/// The paper under the art that translucent art is blended with before the conversion
|
||||
/// ([`crate::display_profile::convert_over`]). None without a display profile, and in Outline.
|
||||
pub backdrop: Option<std::sync::Arc<crate::display_profile::Backdrop>>,
|
||||
/// The active color settings ([`vectorcraft_color::cms::active_settings`]) and the loaded
|
||||
/// profiles' generation ([`vectorcraft_color::cms::profiles_generation`]) the frame's colors
|
||||
/// were converted with: Edit › Color Settings, a profile loaded again under its name or removed,
|
||||
/// and the front document's assigned profiles change them without changing the document.
|
||||
pub color: (vectorcraft_color::cms::ColorSettings, u64),
|
||||
/// The active color settings ([`vectorcraft_color::cms::active_settings`]), the working color
|
||||
/// settings ([`vectorcraft_color::cms::working_settings`]) and the loaded profiles' generation
|
||||
/// ([`vectorcraft_color::cms::profiles_generation`]) the frame's colors were converted with:
|
||||
/// Edit › Color Settings, a profile loaded again under its name or removed, and the front
|
||||
/// document's assigned profiles change them without changing the document. A proof of the
|
||||
/// working CMYK space converts through the working settings, which can change while the active
|
||||
/// settings stay the same.
|
||||
pub color: (vectorcraft_color::cms::ColorSettings, vectorcraft_color::cms::ColorSettings, u64),
|
||||
}
|
||||
|
||||
impl CacheKey {
|
||||
|
||||
@@ -923,7 +923,7 @@ fn cache_key(
|
||||
// Preferences › Performance › Use Monitor Profile for Canvas.
|
||||
display: app.display_profile.key(app.session.prefs.monitor_profile_display),
|
||||
backdrop: backdrop(app, st, app.outline_view()),
|
||||
color: (vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::profiles_generation()),
|
||||
color: (vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::working_settings(), vectorcraft_color::cms::profiles_generation()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4882,7 +4882,7 @@ fn color_settings_and_a_reloaded_profile_render_the_canvas_again() {
|
||||
};
|
||||
load(&mut app, cms::GENERIC_CMYK);
|
||||
app.run("edit.assignProfile", json!({"cmyk": name})).unwrap();
|
||||
let assigned = middle(&mut app).unwrap_or(first);
|
||||
let assigned = middle(&mut app).expect("assigning a profile re-renders the canvas");
|
||||
assert!(near(assigned, generic), "through the assigned copy of the working space: {assigned:?}, not {generic:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed: no re-render");
|
||||
// The same name, the settings as they were: only the profile's file is new.
|
||||
@@ -4890,6 +4890,20 @@ fn color_settings_and_a_reloaded_profile_render_the_canvas_again() {
|
||||
let reloaded = middle(&mut app).expect("the profile loaded again re-renders the canvas");
|
||||
assert!(near(reloaded, device), "through the profile's new file: {reloaded:?}, not {device:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed since: no re-render");
|
||||
|
||||
// A proof of the working CMYK space converts through the working settings. With the document's
|
||||
// assigned profile in place of the working CMYK space, a new working CMYK space leaves the
|
||||
// active settings as they were and changes only the proof.
|
||||
app.run("view.proofSetup", json!({"target": "workingCmyk"})).unwrap();
|
||||
app.run("view.proofColors", json!({"on": true})).unwrap();
|
||||
let proofed = middle(&mut app).expect("Proof Colors re-renders the canvas");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed: no re-render");
|
||||
let active = cms::active_settings();
|
||||
app.run("edit.colorSettings", json!({"cmyk": cms::DEVICE_CMYK})).unwrap();
|
||||
let reproofed = middle(&mut app).expect("a new working CMYK space re-renders the proof");
|
||||
assert_eq!(cms::active_settings(), active, "the assigned profile keeps the active settings");
|
||||
assert!(!near(reproofed, [proofed[0], proofed[1], proofed[2]]), "the proof through the new working CMYK space: {reproofed:?}, not {proofed:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed since: no re-render");
|
||||
}
|
||||
|
||||
/// Guides & Grid › Show Pixel Grid (Above 600% Zoom) (#394): in Pixel Preview at 600% zoom and
|
||||
|
||||
Reference in new issue
Block a user