From 05d0fac516098b8c56796063bb5064a4b1304ee3 Mon Sep 17 00:00:00 2001 From: bigfoodk Date: Mon, 30 Sep 2024 11:17:22 +0900 Subject: [PATCH] Fix size display --- .../episode_editor/scene_sprite_editor/size_tool.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/luda-editor/new-client/src/episode_editor/scene_sprite_editor/size_tool.rs b/luda-editor/new-client/src/episode_editor/scene_sprite_editor/size_tool.rs index f6e232a87..778f10ee5 100644 --- a/luda-editor/new-client/src/episode_editor/scene_sprite_editor/size_tool.rs +++ b/luda-editor/new-client/src/episode_editor/scene_sprite_editor/size_tool.rs @@ -1,3 +1,5 @@ +use std::ops::Deref; + use crate::*; pub static SIZE_TOOL_DRAGGING_ATOM: Atom> = Atom::uninitialized(); @@ -19,12 +21,18 @@ impl Component for SizeTool<'_> { let (dragging, set_dragging) = ctx.init_atom(&SIZE_TOOL_DRAGGING_ATOM, || None); + let size_radius = dragging + .deref() + .as_ref() + .map(|dragging| dragging.radius) + .unwrap_or(size_radius); + ctx.compose(|ctx| { table::vertical([ table::fixed(64.px(), |wh, ctx| { ctx.add(typography::body::left( wh.height, - format!("크기 - {}", size_radius.round()), + format!("크기 - {}", size_radius), Color::WHITE, )); }),