Skip to content

Commit

Permalink
changed color to yellow
Browse files Browse the repository at this point in the history
  • Loading branch information
0SlowPoke0 committed Jan 14, 2025
1 parent cb7c4ad commit 48abdcb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ pub fn path_overlays(document: &DocumentMessageHandler, shape_editor: &mut Shape
bezier_rs::BezierHandles::Quadratic { handle } if not_under_anchor(handle, bezier.start) && not_under_anchor(handle, bezier.end) => {
overlay_context.line(handle, bezier.start, None);
overlay_context.line(handle, bezier.end, None);
overlay_context.manipulator_handle(handle, is_selected(selected, ManipulatorPointId::PrimaryHandle(segment_id)));
overlay_context.manipulator_handle(handle, is_selected(selected, ManipulatorPointId::PrimaryHandle(segment_id)), None);
}
bezier_rs::BezierHandles::Cubic { handle_start, handle_end } => {
if not_under_anchor(handle_start, bezier.start) {
overlay_context.line(handle_start, bezier.start, None);
overlay_context.manipulator_handle(handle_start, is_selected(selected, ManipulatorPointId::PrimaryHandle(segment_id)));
overlay_context.manipulator_handle(handle_start, is_selected(selected, ManipulatorPointId::PrimaryHandle(segment_id)), None);
}
if not_under_anchor(handle_end, bezier.end) {
overlay_context.line(handle_end, bezier.end, None);
overlay_context.manipulator_handle(handle_end, is_selected(selected, ManipulatorPointId::EndHandle(segment_id)));
overlay_context.manipulator_handle(handle_end, is_selected(selected, ManipulatorPointId::EndHandle(segment_id)), None);
}
}
_ => {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl OverlayContext {
}
}

pub fn manipulator_handle(&mut self, position: DVec2, selected: bool) {
pub fn manipulator_handle(&mut self, position: DVec2, selected: bool, optional_stroke_style: Option<&str>) {
let position = position.round() - DVec2::splat(0.5);

self.render_context.begin_path();
Expand All @@ -137,7 +137,7 @@ impl OverlayContext {

let fill = if selected { COLOR_OVERLAY_BLUE } else { COLOR_OVERLAY_WHITE };
self.render_context.set_fill_style_str(fill);
self.render_context.set_stroke_style_str(COLOR_OVERLAY_BLUE);
self.render_context.set_stroke_style_str(optional_stroke_style.unwrap_or(COLOR_OVERLAY_BLUE));
self.render_context.fill();
self.render_context.stroke();
}
Expand Down
4 changes: 2 additions & 2 deletions editor/src/messages/tool/common_functionality/snapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ impl SnapManager {
overlay_context.line(viewport, target, None);
}
for &target in align.iter().flatten() {
overlay_context.manipulator_handle(target, false);
overlay_context.manipulator_handle(target, false, None);
}
if any_align {
overlay_context.manipulator_handle(viewport, false);
overlay_context.manipulator_handle(viewport, false, None);
}

if !any_align && ind.distribution_equal_distance_x.is_none() && ind.distribution_equal_distance_y.is_none() {
Expand Down
6 changes: 3 additions & 3 deletions editor/src/messages/tool/tool_messages/gradient_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ impl Fsm for GradientToolFsmState {
let (start, end) = (transform.transform_point2(start), transform.transform_point2(end));

overlay_context.line(start, end, None);
overlay_context.manipulator_handle(start, dragging == Some(GradientDragTarget::Start));
overlay_context.manipulator_handle(end, dragging == Some(GradientDragTarget::End));
overlay_context.manipulator_handle(start, dragging == Some(GradientDragTarget::Start), None);
overlay_context.manipulator_handle(end, dragging == Some(GradientDragTarget::End), None);

for (index, (position, _)) in stops.0.into_iter().enumerate() {
if position.abs() < f64::EPSILON * 1000. || (1. - position).abs() < f64::EPSILON * 1000. {
continue;
}

overlay_context.manipulator_handle(start.lerp(end, position), dragging == Some(GradientDragTarget::Step(index)));
overlay_context.manipulator_handle(start.lerp(end, position), dragging == Some(GradientDragTarget::Step(index)), None);
}
}

Expand Down
8 changes: 4 additions & 4 deletions editor/src/messages/tool/tool_messages/path_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,10 @@ impl Fsm for PathToolFsmState {
if let Some(closest_segment) = &tool_data.segment {
overlay_context.manipulator_anchor(closest_segment.closest_point_to_viewport(), false, Some(COLOR_OVERLAY_YELLOW));
if let (Some(handle1), Some(handle2)) = closest_segment.handle_positions(document.metadata()) {
overlay_context.line(closest_segment.closest_point_to_viewport(), handle1, None);
overlay_context.line(closest_segment.closest_point_to_viewport(), handle2, None);
overlay_context.manipulator_handle(handle1, false);
overlay_context.manipulator_handle(handle2, false);
overlay_context.line(closest_segment.closest_point_to_viewport(), handle1, Some(COLOR_OVERLAY_YELLOW));
overlay_context.line(closest_segment.closest_point_to_viewport(), handle2, Some(COLOR_OVERLAY_YELLOW));
overlay_context.manipulator_handle(handle1, false, Some(COLOR_OVERLAY_YELLOW));
overlay_context.manipulator_handle(handle2, false, Some(COLOR_OVERLAY_YELLOW));
}
}

Expand Down
6 changes: 3 additions & 3 deletions editor/src/messages/tool/tool_messages/pen_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,12 @@ impl Fsm for PenToolFsmState {

if self == PenToolFsmState::DraggingHandle && valid(next_anchor, handle_end) {
// Draw the handle circle for the currently-being-dragged-out incoming handle (opposite the one currently being dragged out)
overlay_context.manipulator_handle(handle_end, false);
overlay_context.manipulator_handle(handle_end, false, None);
}

if valid(anchor_start, handle_start) {
// Draw the handle circle for the most recently placed anchor's outgoing handle (which is currently influencing the currently-being-placed segment)
overlay_context.manipulator_handle(handle_start, false);
overlay_context.manipulator_handle(handle_start, false, None);
}
} else {
// Draw the whole path and its manipulators when the user is clicking-and-dragging out from the most recently placed anchor to set its outgoing handle, during which it would otherwise not have its overlays drawn
Expand All @@ -614,7 +614,7 @@ impl Fsm for PenToolFsmState {

if self == PenToolFsmState::DraggingHandle && valid(next_anchor, next_handle_start) {
// Draw the handle circle for the currently-being-dragged-out outgoing handle (the one currently being dragged out, under the user's cursor)
overlay_context.manipulator_handle(next_handle_start, false);
overlay_context.manipulator_handle(next_handle_start, false, None);
}

if self == PenToolFsmState::DraggingHandle {
Expand Down

0 comments on commit 48abdcb

Please sign in to comment.