mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-28 04:16:46 -06:00
Merge #1288
This commit is contained in:
@@ -1249,6 +1249,7 @@ name = "English"
|
||||
"Server address" = "Server address"
|
||||
"Server for online sharing" = "Server for online sharing"
|
||||
"Set as default" = "Set as default"
|
||||
"Set corner smoothing to 60%" = "Set corner smoothing to 60%"
|
||||
"Set variable" = "Set variable"
|
||||
"Set variable mode" = "Set variable mode"
|
||||
"Set variable {name}" = "Set variable {name}"
|
||||
|
||||
@@ -55,6 +55,21 @@ fn field(u: &Ui, k: usize) -> Rect {
|
||||
u.ctx.read_response(Id::new(("corner", k)).with("field")).expect("corner field shows").rect
|
||||
}
|
||||
|
||||
/// The iOS button next to Corner smoothing sets 60% in one undo step, as the help page's "click
|
||||
/// iOS to set corner smoothing to 60%" describes.
|
||||
#[test]
|
||||
fn ios_button_sets_corner_smoothing_to_60_percent() {
|
||||
let (mut u, r) = scene();
|
||||
let t = named_button(&mut u, "Individual corners");
|
||||
click(&mut u, t);
|
||||
let history = u.app.session.undo_depth().0;
|
||||
let ios = named_button(&mut u, "iOS");
|
||||
click(&mut u, ios);
|
||||
let smoothing = u.app.session.doc().unwrap().node(r).unwrap().corners.smoothing;
|
||||
assert!((smoothing - 0.6).abs() < 1e-9, "smoothing is {smoothing}");
|
||||
assert_eq!(u.app.session.undo_depth().0, history + 1);
|
||||
}
|
||||
|
||||
/// The fields sit at their corners, and typing in the bottom right one sets only that corner in a
|
||||
/// single undo step (#1002: the bottom row showed bottom right on the left).
|
||||
#[test]
|
||||
|
||||
@@ -915,7 +915,9 @@ fn appearance(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) {
|
||||
row(ui, 32.0, |ui| {
|
||||
let e = widgets::number_field(ui, Id::new("smoothing"), Lead::None, sm, "%", col, 1.0);
|
||||
app.field(&ids, "cornerSmoothing", e, |v| json!((v / 100.0).clamp(0.0, 1.0)));
|
||||
widgets::label(ui, "iOS: 60%", Tokens::get(ui.ctx()).text_tertiary);
|
||||
if widgets::button(ui, tr("iOS"), false, true).on_hover_text(tr("Set corner smoothing to 60%")).clicked() {
|
||||
app.set_props(&ids, json!({"cornerSmoothing": 0.6}));
|
||||
}
|
||||
});
|
||||
}
|
||||
let blend = common(doc, sel, |n| n.blend);
|
||||
|
||||
Reference in New Issue
Block a user