Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions editor/src/document/document_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ pub enum VectorManipulatorSegment {

#[derive(PartialEq, Clone, Debug)]
pub struct VectorManipulatorShape {
/// The path to the layer
pub layer_path: Vec<LayerId>,
/// The outline of the shape
pub path: kurbo::BezPath,
/// The control points / manipulator handles
pub segments: Vec<VectorManipulatorSegment>,
/// The compound Bezier curve is closed
pub closed: bool,
/// The transformation matrix to apply
pub transform: DAffine2,
}

Expand Down Expand Up @@ -266,9 +273,11 @@ impl DocumentMessageHandler {
.collect::<Vec<VectorManipulatorSegment>>();

Some(VectorManipulatorShape {
layer_path: path_to_shape.to_vec(),
path,
segments,
transform: viewport_transform,
closed: shape.closed,
})
});

Expand Down
4 changes: 4 additions & 0 deletions editor/src/input/input_mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ impl Default for Mapping {
entry! {action=LineMessage::Abort, key_down=Rmb},
entry! {action=LineMessage::Abort, key_down=KeyEscape},
entry! {action=LineMessage::Redraw{center: KeyAlt, lock_angle: KeyControl, snap_angle: KeyShift}, triggers=[KeyAlt, KeyShift, KeyControl]},
// Path
entry! {action=PathMessage::DragStart, key_down=Lmb},
entry! {action=PathMessage::PointerMove, message=InputMapperMessage::PointerMove},
entry! {action=PathMessage::DragStop, key_up=Lmb},
// Pen
entry! {action=PenMessage::PointerMove, message=InputMapperMessage::PointerMove},
entry! {action=PenMessage::DragStart, key_down=Lmb},
Expand Down
Loading