A few minor lints and docs (#1436)

* A few minor lints and docs

* Added required packages to compile on Debian-style linux
* Inlined some format args, and removed some `&` in args (they cause about 6% slowdown that compiler cannot inline)
* a few spelling mistakes

* fix fmt
This commit is contained in:
Yuri Astrakhan
2023-10-18 23:33:10 -07:00
committed by GitHub
parent 67edac4aca
commit 3d4e3a74e5
51 changed files with 140 additions and 158 deletions
@@ -60,16 +60,16 @@ impl OverlayRenderer {
self.layer_overlay_visibility(document, layer, true, responses);
let outline_cache = self.shape_overlay_cache.get(&layer);
trace!("Overlay: Outline cache {:?}", &outline_cache);
trace!("Overlay: Outline cache {outline_cache:?}");
// Create an outline if we do not have a cached one
if outline_cache.is_none() {
let outline_path = self.create_shape_outline_overlay(graphene_core::vector::Subpath::from_bezier_rs(subpaths), responses);
self.shape_overlay_cache.insert(layer, outline_path.clone());
Self::place_outline_overlays(outline_path.clone(), &transform, responses);
trace!("Overlay: Creating new outline {:?}", &outline_path);
trace!("Overlay: Creating new outline {outline_path:?}");
} else if let Some(outline_path) = outline_cache {
trace!("Overlay: Updating overlays for {:?} owning layer: {:?}", outline_path, layer);
trace!("Overlay: Updating overlays for {outline_path:?} owning layer: {layer:?}");
Self::modify_outline_overlays(outline_path.clone(), graphene_core::vector::Subpath::from_bezier_rs(subpaths), responses);
Self::place_outline_overlays(outline_path.clone(), &transform, responses);
}
@@ -294,7 +294,7 @@ impl OverlayRenderer {
/// Removes the manipulator overlays from the overlay document.
fn remove_manipulator_group_overlays(overlay_paths: &ManipulatorGroupOverlays, responses: &mut VecDeque<Message>) {
overlay_paths.iter().flatten().for_each(|layer_id| {
trace!("Overlay: Sending delete message for: {:?}", layer_id);
trace!("Overlay: Sending delete message for: {layer_id:?}");
responses.add(DocumentMessage::Overlays(Operation::DeleteLayer { path: layer_id.clone() }.into()));
});
}
@@ -71,7 +71,7 @@ impl ShapeState {
}
if let Some((layer, manipulator_point_id)) = self.find_nearest_point_indices(document, mouse_position, select_threshold) {
trace!("Selecting... manipulator point: {:?}", manipulator_point_id);
trace!("Selecting... manipulator point: {manipulator_point_id:?}");
let subpaths = get_subpaths(layer, document)?;
let manipulator_group = get_manipulator_groups(subpaths).find(|group| group.id == manipulator_point_id.group)?;
@@ -631,7 +631,7 @@ impl ShapeState {
if let Some((manipulator_point_id, distance_squared)) = Self::closest_point_in_layer(document, layer, mouse_position) {
// Choose the first point under the threshold
if distance_squared < select_threshold_squared {
trace!("Selecting... manipulator point: {:?}", manipulator_point_id);
trace!("Selecting... manipulator point: {manipulator_point_id:?}");
return Some((layer, manipulator_point_id));
}
}
@@ -317,7 +317,7 @@ impl SelectToolData {
// let layer = match document.document_legacy.layer(layer_path) {
// Ok(layer) => layer.clone(),
// Err(e) => {
// warn!("Could not access selected layer {:?}: {:?}", layer_path, e);
// warn!("Could not access selected layer {layer_path:?}: {e:?}");
// continue;
// }
// };
+2 -8
View File
@@ -438,10 +438,7 @@ pub fn tool_message_to_tool_type(tool_message: &ToolMessage) -> ToolType {
// ToolMessage::Relight(_) => ToolType::Relight,
ToolMessage::Imaginate(_) => ToolType::Imaginate,
ToolMessage::Frame(_) => ToolType::Frame,
_ => panic!(
"Conversion from ToolMessage to ToolType impossible because the given ToolMessage does not have a matching ToolType. Got: {:?}",
tool_message
),
_ => panic!("Conversion from ToolMessage to ToolType impossible because the given ToolMessage does not have a matching ToolType. Got: {tool_message:?}"),
}
}
@@ -475,10 +472,7 @@ pub fn tool_type_to_activate_tool_message(tool_type: ToolType) -> ToolMessageDis
// ToolType::Relight => ToolMessageDiscriminant::ActivateToolRelight,
ToolType::Imaginate => ToolMessageDiscriminant::ActivateToolImaginate,
ToolType::Frame => ToolMessageDiscriminant::ActivateToolFrame,
_ => panic!(
"Conversion from ToolType to ToolMessage impossible because the given ToolType does not have a matching ToolMessage. Got: {:?}",
tool_type
),
_ => panic!("Conversion from ToolType to ToolMessage impossible because the given ToolType does not have a matching ToolMessage. Got: {tool_type:?}"),
}
}