mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-20 17:06:42 +00:00
Delete Anchor Point: options bar says the tool has no options
The test that pinned the old Delete hint goes.
This commit is contained in:
1 parent
fb3b6a4b70
commit
fdf1daa4b3
2 files changed
+4
-12
No files matched your search
@@ -1,6 +1,5 @@
|
||||
//! #12731: the Add Anchor Point options bar holds the preset picker and "No options for the Add
|
||||
//! Anchor Point Tool." centred in the rest of the bar, as in Photoshop; the Delete Anchor Point bar
|
||||
//! keeps its hint.
|
||||
//! Anchor Point Tool." centred in the rest of the bar, as in Photoshop.
|
||||
|
||||
use egui::vec2;
|
||||
use egui_kittest::Harness;
|
||||
@@ -39,11 +38,3 @@ fn add_anchor_point_bar_says_it_has_no_options() {
|
||||
let mid = (rect.min.x + rect.max.x) / 2.0;
|
||||
assert!((mid - centre).abs() < 20.0, "text centre {mid} vs remaining bar centre {centre}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn delete_anchor_point_bar_keeps_its_hint() {
|
||||
let h = harness(Tool::DeleteAnchorPoint);
|
||||
let hint = crate::i18n::fmt("Click an anchor point to delete it · {alt}-click a segment to add one", &[("alt", &crate::shortcuts::pretty("Alt"))]);
|
||||
h.get_by_label(&hint);
|
||||
assert!(h.query_by_label(NO_OPTIONS).is_none());
|
||||
}
|
||||
@@ -51,8 +51,9 @@ pub fn options_bar(app: &mut PhotocraftApp, ui: &mut egui::Ui, tool: Tool) -> bo
|
||||
return true;
|
||||
}
|
||||
if tool == Tool::DeleteAnchorPoint {
|
||||
let hint = tl!("Click an anchor point to delete it · {alt}-click a segment to add one");
|
||||
lbl(ui, &crate::i18n::fmt(hint, &[("alt", &crate::shortcuts::pretty("Alt"))]));
|
||||
// Photoshop centres this in the rest of the bar after the preset picker (#12827).
|
||||
let text = egui::RichText::new(tl!("No options for the Delete Anchor Point Tool.")).color(t.text_dim).size(12.0);
|
||||
ui.add_sized([ui.available_width(), ui.available_height()], egui::Label::new(text));
|
||||
return true;
|
||||
}
|
||||
if matches!(tool, Tool::Pen | Tool::FreeformPen | Tool::CurvaturePen) {
|
||||
|
||||
Reference in new issue
Block a user