Skip to content

Commit

Permalink
Fix size display
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfoodK committed Sep 30, 2024
1 parent 500d7a7 commit 05d0fac
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::ops::Deref;

use crate::*;

pub static SIZE_TOOL_DRAGGING_ATOM: Atom<Option<SizeToolDragging>> = Atom::uninitialized();
Expand All @@ -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,
));
}),
Expand Down

0 comments on commit 05d0fac

Please sign in to comment.