mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:24:24 +00:00
merge-c: c1: rustfmt
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user