Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

Path Precision Tools: the Shared Edges fields read like the others in the panel

bflatastic41508e7b240e
diff --git a/crates/ui-egui/src/addons/pathtools/shared_edge.rs b/crates/ui-egui/src/addons/pathtools/shared_edge.rs
index bc58183f3..2e1365ffa 100644
--- a/crates/ui-egui/src/addons/pathtools/shared_edge.rs
+++ b/crates/ui-egui/src/addons/pathtools/shared_edge.rs
@@ -5,13 +5,15 @@ use egui::Ui;
use serde_json::{Value, json};
use vectorcraft_tools::addons::shared_edge::{COINCIDENCE, DIAMETER, DIAMETER_RANGE, ID, MAX_COINCIDENCE};
-use super::{LABEL_W, run};
+use super::run;
use crate::VectorcraftApp;
use crate::widgets;
/// The menu's command: the tool, with the panel its values are in.
pub const COMMAND: &str = "addon.pathtools.sharedEdgeTool";
const FIELD_W: f32 = 96.0;
+/// Wide enough for "Coincidence:".
+const LABEL_W: f32 = 80.0;
/// Object › Plug-ins › Path Precision Tools › Shared Edge Merge Tool.
pub fn open(app: &mut VectorcraftApp) -> Result<Value, String> {
@@ -27,12 +29,12 @@ pub(super) fn section(app: &mut VectorcraftApp, ui: &mut Ui) {
widgets::subheader(ui, "Shared Edges");
let mut set: Option<Value> = None;
widgets::label_row(ui, tl!("Diameter:"), LABEL_W, |ui| {
- if let Some(v) = widgets::range_field(ui, "shared-edge-diameter", diameter, DIAMETER_RANGE.0..=DIAMETER_RANGE.1, "pt", 2, FIELD_W) {
+ if let Some(v) = widgets::range_field(ui, "shared-edge-diameter", diameter, DIAMETER_RANGE.0..=DIAMETER_RANGE.1, " pt", 2, FIELD_W) {
set = Some(json!({ "diameter": v }));
}
});
widgets::label_row(ui, tl!("Coincidence:"), LABEL_W, |ui| {
- if let Some(v) = widgets::range_field(ui, "shared-edge-tolerance", tolerance, 0.0..=MAX_COINCIDENCE, "pt", 3, FIELD_W) {
+ if let Some(v) = widgets::range_field(ui, "shared-edge-tolerance", tolerance, 0.0..=MAX_COINCIDENCE, " pt", 3, FIELD_W) {
set = Some(json!({ "tolerance": v }));
}
});