Minor code cleanup and spelling fix

This commit is contained in:
Keavon Chambers
2024-03-16 00:30:29 -07:00
parent 6630e2b964
commit 1a2a0e8757
6 changed files with 29 additions and 30 deletions
@@ -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,
}