From 97df9bd164de853e5719c5a7fd4b4d24a9a071c6 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 19 Nov 2026 14:50:29 +0100 Subject: [PATCH] Remove empty inspector scroll range --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/canvas-pilot/src/gui.rs | 27 +++++++++++---------------- crates/canvas-pilot/src/main.rs | 7 ------- docs/canvas-pilot/changelog.md | 7 +++++++ 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4fbf7e..b5bf6e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -602,7 +602,7 @@ dependencies = [ [[package]] name = "canvas-pilot" -version = "0.10.0-rc.18" +version = "0.10.1" dependencies = [ "base64 0.22.1", "craft-dwg", diff --git a/Cargo.toml b/Cargo.toml index f96ae9c..0c4abdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/canvas-pilot"] resolver = "3" [workspace.package] -version = "0.10.0-rc.18" +version = "0.10.1" edition = "2024" license = "MIT" repository = "https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot" diff --git a/crates/canvas-pilot/src/gui.rs b/crates/canvas-pilot/src/gui.rs index f430b85..5619379 100644 --- a/crates/canvas-pilot/src/gui.rs +++ b/crates/canvas-pilot/src/gui.rs @@ -1571,9 +1571,14 @@ impl Editor { }; let row_offset = (row_count as f32 - 2.0) * 44.0 - input_reference_rows as f32 * (44.0 - capture_ui::INPUT_REFERENCE_ROW_HEIGHT); + let details_height = match self.layout.selected_indices().len() { + 0 => 220.0, + 1 => 958.0, + _ => 1071.0, + }; let palette = theme::palette(ui.ctx()); let (r, _) = ui.allocate_exact_size( - Vec2::new(ui.available_width(), 1071.0 + row_offset), + Vec2::new(ui.available_width(), details_height + row_offset), egui::Sense::hover(), ); let ink = Ink::new(ui, r); @@ -2103,16 +2108,6 @@ impl Editor { ink.text( 0.0, 663.0, - &tr(ink.painter.ctx(), "ui.visible-box-center-position"), - 11.0, - palette.cyan, - ); - let [h, v] = g.center(); - ink.field(0.0, 693.0, half, "Horizontal · from left", &number(h)); - ink.field(half + 12.0, 693.0, half, "Vertical · from top", &number(v)); - ink.text( - 0.0, - 776.0, &tr( ink.painter.ctx(), "ui.layer-properties-crops-provisional-device-mapping", @@ -2120,17 +2115,17 @@ impl Editor { 12.0, palette.muted, ); - ink.button(0.0, 808.0, w, "Copy layer values", true); - if click(ui, &ink, [0.0, 808.0, w, 34.0], "copy-values") { + ink.button(0.0, 695.0, w, "Copy layer values", true); + if click(ui, &ink, [0.0, 695.0, w, 34.0], "copy-values") { self.copy(ui.ctx()); } - ink.button(0.0, 857.0, w, "Paste layer(s) values", false); - if click(ui, &ink, [0.0, 857.0, w, 34.0], "paste-button") { + ink.button(0.0, 744.0, w, "Paste layer(s) values", false); + if click(ui, &ink, [0.0, 744.0, w, 34.0], "paste-button") { self.open_paste(String::new()); } ink.text( 0.0, - 912.0, + 799.0, &tr( ink.painter.ctx(), "ui.or-ctrl-cmd-v-with-the-viewport-focused", diff --git a/crates/canvas-pilot/src/main.rs b/crates/canvas-pilot/src/main.rs index 832e3a8..198518d 100644 --- a/crates/canvas-pilot/src/main.rs +++ b/crates/canvas-pilot/src/main.rs @@ -143,13 +143,6 @@ impl Ink { ); self.text(x + 12.0, y + 9.0, label, 13.0, palette.text); } - - fn field(&self, x: f32, y: f32, w: f32, label: &str, value: &str) { - let palette = theme::palette(self.painter.ctx()); - self.text(x, y, label, 12.0, palette.muted); - self.card(x, y + 23.0, w, 42.0, palette.field, palette.line); - self.text(x + 12.0, y + 34.0, value, 18.0, palette.text); - } } const SCREEN_LABEL_TOP: f32 = 24.0; diff --git a/docs/canvas-pilot/changelog.md b/docs/canvas-pilot/changelog.md index f16a073..2df4700 100644 --- a/docs/canvas-pilot/changelog.md +++ b/docs/canvas-pilot/changelog.md @@ -4,6 +4,13 @@ ## Unreleased +### v0.10.1 + +- Size the right inspector to its visible empty/reference message when no layer is + selected, removing the long blank scroll range while retaining scrolling for + layer properties and long layer/reference lists. Remove the duplicated read-only + **Visible box / center position** block and pull the copy/paste actions upward. + ## v0.10.0-rc.18 — 2026-11-19 Published release candidate collecting the extreme-zoom performance fix and