diff --git a/locales/en-US/opencadstudio.ftl b/locales/en-US/opencadstudio.ftl index 01541f940..fb8218ddc 100644 --- a/locales/en-US/opencadstudio.ftl +++ b/locales/en-US/opencadstudio.ftl @@ -3776,7 +3776,7 @@ properties = .current-vertex-title-case = Current Vertex .current-vertex-sentence-case = Current vertex .current-control-point = Current Control point - .current-fit-point = Current Fit point + .current-fit-point = Current fit point .cv-frame = CV frame .cutting-line = Cutting Line .dwg-payload = DWG Payload diff --git a/src/entities/spline.rs b/src/entities/spline.rs index 5c143ea47..cc4d7e2b8 100644 --- a/src/entities/spline.rs +++ b/src/entities/spline.rs @@ -4,8 +4,8 @@ use cadkernel::space::{NurbsCurve3, Parameterization}; use crate::command::EntityTransform; use crate::entities::common::{ - dropdown_grip, edit_prop as edit, edit_scalar_prop as edit_scalar, format_length, - parse_f64, ro_prop as ro, round_grip, square_grip, + dropdown_grip, edit_prop as edit, edit_scalar_prop as edit_scalar, parse_f64, + ro_prop as ro, round_grip, square_grip, }; use crate::entities::traits::RenderConvertible; use crate::scene::convert::acad_to_render::{RenderEntity, RenderObject}; @@ -639,7 +639,7 @@ fn properties(spline: &Spline) -> Vec { count.to_string(), ), index_prop( - t!("Current Fit point").as_ref(), + t!("Current fit point").as_ref(), "current_fit_point", index, count, @@ -790,10 +790,10 @@ fn properties(spline: &Spline) -> Vec { ]); } if show_fit { - misc.push(ro( + misc.push(edit( t!("Fit tolerance").as_ref(), "fit_tolerance", - format_length(spline.fit_tolerance), + spline.fit_tolerance, )); } @@ -858,9 +858,6 @@ fn apply_geom_prop(spline: &mut Spline, field: &str, value: &str) { { return; } - if field == "fit_tolerance" { - return; - } if matches!(field, "ctrl_pt_x" | "ctrl_pt_y" | "ctrl_pt_z" | "weight") && uses_fit_method(spline) && !convert_to_control_method(spline) @@ -916,6 +913,11 @@ fn apply_geom_prop(spline: &mut Spline, field: &str, value: &str) { fp.z = v; } } + "fit_tolerance" => { + if v.is_finite() && v >= 0.0 { + spline.fit_tolerance = v; + } + } "start_tan_x" | "start_tan_y" | "start_tan_z" => { if !tangent_is_set(&spline.begin_tangent) { spline.begin_tangent = effective_begin_tangent; diff --git a/src/locale_catalog.rs b/src/locale_catalog.rs index 700d2f68c..2814da757 100644 --- a/src/locale_catalog.rs +++ b/src/locale_catalog.rs @@ -693,7 +693,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static "Current MLeader style: {}" => Some(("layers", "current-mleader-style")), "Current Vertex" => Some(("properties", "current-vertex-title-case")), "Current Control point" => Some(("properties", "current-control-point")), - "Current Fit point" => Some(("properties", "current-fit-point")), + "Current fit point" => Some(("properties", "current-fit-point")), "CV frame" => Some(("properties", "cv-frame")), "Current annotation scale: {name}" => Some(("view", "current-annotation-scale-name")), "Current dim style set to '{}'." => Some(("common", "current-dim-style-set-to")), diff --git a/src/ui/ribbon/draw_panel.rs b/src/ui/ribbon/draw_panel.rs index 6ef8bf31d..f2e4677c4 100644 --- a/src/ui/ribbon/draw_panel.rs +++ b/src/ui/ribbon/draw_panel.rs @@ -7,7 +7,7 @@ use iced::{Element, Fill, Theme}; use super::widgets::{ make_icon, make_tip, muted_text_style, popup_panel_style, popup_row_style, tip_style, - tool_btn_style, + tool_btn_style, LARGE_DROPDOWN_ARROW_SIZE, }; use super::{dropdown_backdrop, position_ribbon_dropdown, Ribbon}; use crate::app::Message; @@ -21,6 +21,7 @@ const SCALE: f32 = 0.7; const CELL: f32 = 36.0 * SCALE; const GAP: f32 = 3.0 * SCALE; const OPTION_HEIGHT: f32 = 30.0 * SCALE; +const GROUP_TITLE_ARROW_SIZE: f32 = LARGE_DROPDOWN_ARROW_SIZE * 1.5; pub(super) struct Tool { pub command: &'static str, @@ -170,9 +171,9 @@ pub(super) fn group_title<'a>(title: &'static str, open: &Option) -> Ele }; let expanded = open.as_deref().and_then(parent_panel) == Some(panel.id); let arrow = if expanded { - icons::themed_arrow_up(7.0) + icons::themed_arrow_up(GROUP_TITLE_ARROW_SIZE) } else { - icons::themed_arrow_down(7.0) + icons::themed_arrow_down(GROUP_TITLE_ARROW_SIZE) }; PosReport::new( panel.id, diff --git a/src/ui/ribbon/widgets.rs b/src/ui/ribbon/widgets.rs index 7a77c6d9d..6b20ae107 100644 --- a/src/ui/ribbon/widgets.rs +++ b/src/ui/ribbon/widgets.rs @@ -63,6 +63,8 @@ pub(super) const SMALL_W: f32 = ROW_H; pub(super) const ARROW_W: f32 = ROW_H * 0.4; /// Height of the ▾ strip at the bottom of a large dropdown. pub(super) const LARGE_ARR: f32 = ROW_H * 0.55; +/// Arrow size used under large dropdown tools such as Circle. +pub(super) const LARGE_DROPDOWN_ARROW_SIZE: f32 = 9.0; /// Total ribbon tool-area height = 3 × ROW_H + 6 px v-padding + 12 px group-label. pub(super) const TOOL_BAR_H: f32 = 3.0 * ROW_H + 18.0; /// Height of a collapsed panel button's large representative face (big icon + @@ -706,7 +708,7 @@ pub(super) fn render_large_dropdown<'a>( }); let arr_btn = button( - container(icons::themed_arrow_down(9.0)) + container(icons::themed_arrow_down(LARGE_DROPDOWN_ARROW_SIZE)) .width(Fill) .height(Fill) .align_x(iced::Center)