mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-10 12:29:34 -06:00
Apply review fixes
- crates/engine/src/tools/pointer.rs
This commit is contained in:
@@ -552,7 +552,7 @@ impl Session {
|
||||
Some(Drag::Freeform { mode, points, .. }) => {
|
||||
if mode == "scribble" {
|
||||
// A scribble ending back at its start closes into a filled shape.
|
||||
let closed = points.len() > 3 && points.first().is_some_and(|a| (*a - p).hypot() <= 6.0);
|
||||
let closed = points.len() > 3 && points.first().zip(points.last()).is_some_and(|(a, b)| (*a - *b).hypot() <= 6.0);
|
||||
self.tool.drag = Some(Drag::Freeform { mode, points, pressed: false });
|
||||
return self.finish_freeform(closed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user