Skip to content

Commit 0069539

Browse files
committed
Code review
1 parent 4a70b61 commit 0069539

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

editor/src/messages/tool/common_functionality/graph_modification_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub fn merge_layers(document: &DocumentMessageHandler, first_layer: LayerNodeIde
8686
downstream_input: InputConnector::node(second_layer.to_node(), 1),
8787
input_connector: InputConnector::node(merge_node_id, 1),
8888
});
89-
// Delete the second layer layer node without deleting it's children nodes.
89+
// We delete the second layer node without deleting its child nodes
9090
responses.add(NodeGraphMessage::DeleteNodes {
9191
node_ids: vec![second_layer.to_node()],
9292
delete_children: false,

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

+14-6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ use graph_craft::document::{NodeId, NodeInput};
1616
use graphene_core::Color;
1717
use graphene_core::vector::{PointId, VectorModificationType};
1818
use graphene_std::vector::{HandleId, ManipulatorPointId, NoHashBuilder, SegmentId, VectorData};
19-
19+
use spline_mode::*;
2020
use std::fmt;
2121

22-
// TODO: refactor the code into new module for drawing a Path.
22+
// TODO: Refactor the code into new module for drawing a path
2323
mod spline_mode;
2424

25-
use spline_mode::*;
26-
2725
#[derive(Default)]
2826
pub struct PenTool {
2927
fsm_state: PenToolFsmState,
@@ -100,7 +98,7 @@ pub enum PenToolMessage {
10098
FinalPosition {
10199
final_position: DVec2,
102100
},
103-
// Specific to the Spline mode.
101+
/// Specific to spline mode.
104102
SplineMergeEndpoints,
105103
SwapHandles,
106104
}
@@ -147,7 +145,7 @@ impl PenTool {
147145

148146
DropdownInput::new(vec![tool_mode_entries])
149147
.selected_index(Some((self.options.tool_mode) as u32))
150-
.tooltip("Select Spline to draw smooth curves or select Path to draw a path.")
148+
.tooltip(format!("Path Mode:\n\n{}\n{}", ToolMode::Path.description(), ToolMode::Spline.description()))
151149
.widget_holder()
152150
}
153151
}
@@ -352,6 +350,16 @@ impl fmt::Display for ToolMode {
352350
}
353351
}
354352
}
353+
354+
impl ToolMode {
355+
fn description(&self) -> &'static str {
356+
match self {
357+
ToolMode::Path => "Path mode is the standard Pen tool behavior for drawing Bézier paths.",
358+
ToolMode::Spline => "Spline mode is for placing the control points of a spline curve.",
359+
}
360+
}
361+
}
362+
355363
/// The type of handle which is dragged by the cursor (under the cursor).
356364
///
357365
/// ![Terminology](https://files.keavon.com/-/EachNotedLovebird/capture.png)

frontend/assets/icon-24px-two-tone/vector-spline-tool.svg

-7
This file was deleted.

frontend/src/utility-functions/icons.ts

-2
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ import VectorPathTool from "@graphite-frontend/assets/icon-24px-two-tone/vector-
381381
import VectorPenTool from "@graphite-frontend/assets/icon-24px-two-tone/vector-pen-tool.svg";
382382
import VectorPolygonTool from "@graphite-frontend/assets/icon-24px-two-tone/vector-polygon-tool.svg";
383383
import VectorRectangleTool from "@graphite-frontend/assets/icon-24px-two-tone/vector-rectangle-tool.svg";
384-
import VectorSplineTool from "@graphite-frontend/assets/icon-24px-two-tone/vector-spline-tool.svg";
385384
import VectorTextTool from "@graphite-frontend/assets/icon-24px-two-tone/vector-text-tool.svg";
386385

387386
const TWO_TONE_24PX = {
@@ -405,7 +404,6 @@ const TWO_TONE_24PX = {
405404
VectorPenTool: { svg: VectorPenTool, size: 24 },
406405
VectorRectangleTool: { svg: VectorRectangleTool, size: 24 },
407406
VectorPolygonTool: { svg: VectorPolygonTool, size: 24 },
408-
VectorSplineTool: { svg: VectorSplineTool, size: 24 },
409407
VectorTextTool: { svg: VectorTextTool, size: 24 },
410408
} as const;
411409

0 commit comments

Comments
 (0)