mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 19:18:13 +08:00
Drop redundant conversions, assertions and struct updates
This commit is contained in:
@@ -4164,9 +4164,8 @@ mod document_message_handler_tests {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
// The operation completed without crashing
|
// The operation completed without crashing
|
||||||
// Verifying application still functions by performing another operation
|
// Verifying application still functions by performing another operation, which panics if the folder move left the editor broken
|
||||||
editor.handle_message(DocumentMessage::CreateEmptyFolder).await;
|
editor.handle_message(DocumentMessage::CreateEmptyFolder).await;
|
||||||
assert!(true, "Application didn't crash after folder move operation");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merging nodes whose output isn't wired downstream produces an encapsulating subnetwork with no exports.
|
// Merging nodes whose output isn't wired downstream produces an encapsulating subnetwork with no exports.
|
||||||
|
|||||||
+2
@@ -69,6 +69,8 @@ impl SpiralTurns {
|
|||||||
self.handle_state == SpiralTurnsState::Dragging
|
self.handle_state == SpiralTurnsState::Dragging
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Records one snapshot of the spiral's parameters; grouping them would only move the same fields into a struct
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn store_initial_parameters(
|
pub fn store_initial_parameters(
|
||||||
&mut self,
|
&mut self,
|
||||||
layer: LayerNodeIdentifier,
|
layer: LayerNodeIdentifier,
|
||||||
|
|||||||
@@ -88,11 +88,8 @@ impl ShapeType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn tooltip_description(&self) -> String {
|
pub fn tooltip_description(&self) -> String {
|
||||||
(match self {
|
// TODO: Add descriptions to all the shape tools
|
||||||
// TODO: Add descriptions to all the shape tools
|
String::new()
|
||||||
_ => "",
|
|
||||||
})
|
|
||||||
.into()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn icon_name(&self) -> String {
|
pub fn icon_name(&self) -> String {
|
||||||
|
|||||||
@@ -677,7 +677,6 @@ mod tests {
|
|||||||
down: [10., 15.].map(|y| Rect::from_square(DVec2::new(0., y), 2.)).to_vec(),
|
down: [10., 15.].map(|y| Rect::from_square(DVec2::new(0., y), 2.)).to_vec(),
|
||||||
left: [-12., -15.].map(|x| Rect::from_square(DVec2::new(x, 0.), 2.)).to_vec(),
|
left: [-12., -15.].map(|x| Rect::from_square(DVec2::new(x, 0.), 2.)).to_vec(),
|
||||||
right: [12., 15.].map(|x| Rect::from_square(DVec2::new(x, 0.), 2.)).to_vec(),
|
right: [12., 15.].map(|x| Rect::from_square(DVec2::new(x, 0.), 2.)).to_vec(),
|
||||||
..Default::default()
|
|
||||||
};
|
};
|
||||||
let source = Rect::from_square(DVec2::new(0.3, 0.4), 2.);
|
let source = Rect::from_square(DVec2::new(0.3, 0.4), 2.);
|
||||||
let snap_results = &mut SnapResults::default();
|
let snap_results = &mut SnapResults::default();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ impl MergeByDistanceExt for Vector {
|
|||||||
// Collect points and segments to delete at the end to avoid invalidating indices
|
// Collect points and segments to delete at the end to avoid invalidating indices
|
||||||
let mut points_to_delete = FxHashSet::default();
|
let mut points_to_delete = FxHashSet::default();
|
||||||
let mut segments_to_delete = FxHashSet::default();
|
let mut segments_to_delete = FxHashSet::default();
|
||||||
for (mut collapse_set, average_pos) in collapse.into_iter().zip(average_position.into_iter()) {
|
for (mut collapse_set, average_pos) in collapse.into_iter().zip(average_position) {
|
||||||
// Remove any segments where both endpoints are in the collapse set
|
// Remove any segments where both endpoints are in the collapse set
|
||||||
segments_to_delete.extend(self.segment_domain.iter().filter_map(|(id, start_offset, end_offset, _)| {
|
segments_to_delete.extend(self.segment_domain.iter().filter_map(|(id, start_offset, end_offset, _)| {
|
||||||
let start = self.point_domain.ids()[start_offset];
|
let start = self.point_domain.ids()[start_offset];
|
||||||
|
|||||||
Reference in New Issue
Block a user