mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 01:08:13 +08:00
Minor code cleanup and spelling fix
This commit is contained in:
@@ -434,7 +434,7 @@ pub fn get_layer_snap_points(layer: LayerNodeIdentifier, snap_data: &SnapData, p
|
||||
let document = snap_data.document;
|
||||
if document.metadata().is_artboard(layer) {
|
||||
} else if document.metadata().is_folder(layer) {
|
||||
for child in layer.decendants(document.metadata()) {
|
||||
for child in layer.descendants(document.metadata()) {
|
||||
get_layer_snap_points(child, snap_data, points);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -92,13 +92,11 @@ impl Fsm for FillToolFsmState {
|
||||
let Some(layer_identifier) = document.click(input.mouse.position, &document.network) else {
|
||||
return self;
|
||||
};
|
||||
// TODO: Use a match statement here instead of if-else
|
||||
let color = if color_event == FillToolMessage::FillPrimaryColor {
|
||||
global_tool_data.primary_color
|
||||
} else {
|
||||
global_tool_data.secondary_color
|
||||
let fill = match color_event {
|
||||
FillToolMessage::FillPrimaryColor => Fill::Solid(global_tool_data.primary_color),
|
||||
FillToolMessage::FillSecondaryColor => Fill::Solid(global_tool_data.secondary_color),
|
||||
_ => return self,
|
||||
};
|
||||
let fill = Fill::Solid(color);
|
||||
|
||||
responses.add(DocumentMessage::StartTransaction);
|
||||
responses.add(GraphOperationMessage::FillSet { layer: layer_identifier, fill });
|
||||
@@ -109,7 +107,8 @@ impl Fsm for FillToolFsmState {
|
||||
(FillToolFsmState::Filling, FillToolMessage::PointerUp) => FillToolFsmState::Ready,
|
||||
(FillToolFsmState::Filling, FillToolMessage::Abort) => {
|
||||
responses.add(DocumentMessage::AbortTransaction);
|
||||
return FillToolFsmState::Ready;
|
||||
|
||||
FillToolFsmState::Ready
|
||||
}
|
||||
_ => self,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user