diff --git a/crates/behavior/src/geometry/mod.rs b/crates/behavior/src/geometry/mod.rs index 4a268861f..24886f10d 100644 --- a/crates/behavior/src/geometry/mod.rs +++ b/crates/behavior/src/geometry/mod.rs @@ -18,7 +18,9 @@ pub mod snap; pub use crop::{AspectHold, CropBox, CropGuide, GuideShow, crop_view, crop_view_about, hit_rect, screen_step, turn_grid}; pub use draft::{DraftEvent, DraftKind, DraftPoint, DraftReach, OutlineDraft}; -pub use lock::{AXIS_BAND_DEGREES, Directions, LOCK_HYSTERESIS_DEGREES, axis_or_diagonal, lock_direction, polygon_step, round_to_direction, turn_to_45}; +pub use lock::{ + AXIS_BAND_DEGREES, Directions, LOCK_HYSTERESIS_DEGREES, axis_or_diagonal, lock_direction, polygon_step, round_to_direction, turn_to_45, +}; pub use marquee::{Constraint, MarqueeGesture, MarqueeRect, fixed_size_pixels, marquee_pixels, square_pixels}; pub use move_gesture::{ConstrainStyle, MoveGesture, MoveValue, StrokeLock}; pub use outside::outside_pieces; diff --git a/crates/draw/src/geometry/shape.rs b/crates/draw/src/geometry/shape.rs index fff27a2bd..3a8ce7a58 100644 --- a/crates/draw/src/geometry/shape.rs +++ b/crates/draw/src/geometry/shape.rs @@ -156,11 +156,9 @@ impl ShapeGeometry { pub fn bounds(&self) -> Rect { // pc: crates/ui-egui/src/tools/vector_ui/shapes.rs:85-96 `shape_bounds` (a line's ends' box). match *self { - Self::Rect { rect, .. } - | Self::Ellipse { rect } - | Self::Triangle { rect } - | Self::Polygon { rect, .. } - | Self::Custom { rect, .. } => rect.abs(), + Self::Rect { rect, .. } | Self::Ellipse { rect } | Self::Triangle { rect } | Self::Polygon { rect, .. } | Self::Custom { rect, .. } => { + rect.abs() + } Self::RadialPolygon { center, radius, .. } => Rect::new(center.x - radius, center.y - radius, center.x + radius, center.y + radius), Self::Line { from, to, .. } => Rect::from_points(from, to), } diff --git a/crates/draw/src/ui/shape_drag/tool.rs b/crates/draw/src/ui/shape_drag/tool.rs index b390d8cdf..d21a7a818 100644 --- a/crates/draw/src/ui/shape_drag/tool.rs +++ b/crates/draw/src/ui/shape_drag/tool.rs @@ -12,9 +12,9 @@ use craft_ui::runtime::env::Label; use kurbo::{Point, Vec2}; use super::words::ShapeDragWords; -use crate::ui::shape::VectorMode; use super::{BoxConstraint, ShapeDragEvent, ShapeDragOptions, ShapeDragRules, ShapeFrame, ShapeKind}; use crate::geometry::shape::{BoxRule, MIN_SIDE, RadialFrame, SIDES, ShapeGeometry, box_drag, equilateral_in, line_drag}; +use crate::ui::shape::VectorMode; /// The flattening tolerance of the outline being drawn, in screen points. const OUTLINE_TOLERANCE: f32 = 0.25;