Skip to content

Commit 5fd735b

Browse files
committed
Add handles overlay check when drawing with pen tool
1 parent 2fcc50f commit 5fd735b

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

editor/src/messages/tool/tool_messages/pen_tool.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,9 +1526,10 @@ impl Fsm for PenToolFsmState {
15261526
}
15271527
}
15281528

1529-
// Draw the line between the currently-being-placed anchor and its currently-being-dragged-out outgoing handle (opposite the one currently being dragged out)
1530-
overlay_context.line(next_anchor, next_handle_start, None, None);
1531-
1529+
if display_handles {
1530+
// Draw the line between the currently-being-placed anchor and its currently-being-dragged-out outgoing handle (opposite the one currently being dragged out)
1531+
overlay_context.line(next_anchor, next_handle_start, None, None);
1532+
}
15321533
match tool_options.pen_overlay_mode {
15331534
PenOverlayMode::AllHandles => {
15341535
path_overlays(document, DrawHandles::All, shape_editor, &mut overlay_context);
@@ -1543,11 +1544,13 @@ impl Fsm for PenToolFsmState {
15431544
}
15441545

15451546
if let (Some(anchor_start), Some(handle_start), Some(handle_end)) = (anchor_start, handle_start, handle_end) {
1546-
// Draw the line between the most recently placed anchor and its outgoing handle (which is currently influencing the currently-being-placed segment)
1547-
overlay_context.line(anchor_start, handle_start, None, None);
1547+
if display_handles {
1548+
// Draw the line between the most recently placed anchor and its outgoing handle (which is currently influencing the currently-being-placed segment)
1549+
overlay_context.line(anchor_start, handle_start, None, None);
15481550

1549-
// Draw the line between the currently-being-placed anchor and its incoming handle (opposite the one currently being dragged out)
1550-
overlay_context.line(next_anchor, handle_end, None, None);
1551+
// Draw the line between the currently-being-placed anchor and its incoming handle (opposite the one currently being dragged out)
1552+
overlay_context.line(next_anchor, handle_end, None, None);
1553+
}
15511554

15521555
if self == PenToolFsmState::PlacingAnchor && anchor_start != handle_start && tool_data.modifiers.lock_angle {
15531556
// Draw the line between the currently-being-placed anchor and last-placed point (lock angle bent overlays)
@@ -1562,7 +1565,10 @@ impl Fsm for PenToolFsmState {
15621565
if self == PenToolFsmState::DraggingHandle(tool_data.handle_mode) && valid(next_anchor, handle_end) && display_handles {
15631566
// Draw the handle circle for the currently-being-dragged-out incoming handle (opposite the one currently being dragged out)
15641567
let selected = tool_data.handle_type == TargetHandle::PreviewInHandle;
1565-
overlay_context.manipulator_handle(handle_end, selected, None);
1568+
if display_handles {
1569+
overlay_context.manipulator_handle(handle_end, selected, None);
1570+
overlay_context.manipulator_handle(handle_end, selected, None);
1571+
}
15661572
}
15671573

15681574
if valid(anchor_start, handle_start) && display_handles {

0 commit comments

Comments
 (0)