forked from 1b-agent/opencadstudio-upstream
style: rustfmt the tree so the CI lint check passes
This commit is contained in:
1 parent
1317a7b4fd
commit
6025d8be44
128 files changed
+4097
-1676
No files matched your search
+33
-17
@@ -7,12 +7,10 @@
|
||||
// cache — block-definition and property caches
|
||||
pub mod annotative;
|
||||
pub mod assoc_array;
|
||||
pub mod block_visibility;
|
||||
pub mod compare;
|
||||
pub mod section_cull;
|
||||
pub mod sub_select;
|
||||
pub mod block_service;
|
||||
pub mod block_visibility;
|
||||
pub mod cache;
|
||||
pub mod compare;
|
||||
pub mod convert;
|
||||
pub mod creation_style;
|
||||
pub(crate) mod frame;
|
||||
@@ -20,6 +18,8 @@ pub mod model;
|
||||
pub mod pick;
|
||||
pub mod pipeline;
|
||||
pub(crate) mod render_graph;
|
||||
pub mod section_cull;
|
||||
pub mod sub_select;
|
||||
pub mod text;
|
||||
pub mod view;
|
||||
|
||||
@@ -4932,10 +4932,14 @@ impl Scene {
|
||||
/// Fit a layout's sheet viewport to its page. (Taking the sheet out
|
||||
/// instead would leave a viewport onto the model looking like the sheet.)
|
||||
pub fn fit_layout_sheet(&mut self, layout_name: &str) {
|
||||
let layout = self.document.objects.values().find_map(|object| match object {
|
||||
ObjectType::Layout(layout) if layout.name == layout_name => Some(layout.clone()),
|
||||
_ => None,
|
||||
});
|
||||
let layout = self
|
||||
.document
|
||||
.objects
|
||||
.values()
|
||||
.find_map(|object| match object {
|
||||
ObjectType::Layout(layout) if layout.name == layout_name => Some(layout.clone()),
|
||||
_ => None,
|
||||
});
|
||||
let Some(layout) = layout else {
|
||||
return;
|
||||
};
|
||||
@@ -7514,8 +7518,8 @@ impl Scene {
|
||||
let t_patch = iced::time::Instant::now();
|
||||
// A patch whose set will not equal the memo's runs leaves the memo
|
||||
// holding its own copies, taken while the set is still whole.
|
||||
let shareable = self.uses_resident_memo(block, frozen_layers)
|
||||
&& self.resident_runs_match_memo(block);
|
||||
let shareable =
|
||||
self.uses_resident_memo(block, frozen_layers) && self.resident_runs_match_memo(block);
|
||||
if self.uses_resident_memo(block, frozen_layers) && !shareable {
|
||||
self.detach_memo_backing();
|
||||
}
|
||||
@@ -8059,8 +8063,9 @@ impl Scene {
|
||||
apply_mode(&mut wires, mode);
|
||||
model_wires.extend(wires);
|
||||
}
|
||||
let paper = crate::scene::model::instance_model::expand_stubs(&self.paper_sheet_wires_arc())
|
||||
.into_owned();
|
||||
let paper =
|
||||
crate::scene::model::instance_model::expand_stubs(&self.paper_sheet_wires_arc())
|
||||
.into_owned();
|
||||
(paper, model_wires)
|
||||
}
|
||||
|
||||
@@ -10762,7 +10767,7 @@ impl Scene {
|
||||
let clip = view_rot * (cursor - eye).as_vec3().extend(1.0);
|
||||
if !clip.is_finite() || clip.w <= 1e-6 {
|
||||
return crate::scene::pick::interaction_index::InteractionCandidates::all(wires)
|
||||
.materialize_stubs();
|
||||
.materialize_stubs();
|
||||
}
|
||||
let ndc = clip.truncate() / clip.w;
|
||||
let screen = iced::Point::new(
|
||||
@@ -11322,7 +11327,10 @@ impl Scene {
|
||||
}
|
||||
|
||||
pub fn view_center_surface_pivot(&self, bounds: iced::Rectangle) -> Option<glam::DVec3> {
|
||||
self.surface_pivot_at(bounds, iced::Point::new(bounds.width * 0.5, bounds.height * 0.5))
|
||||
self.surface_pivot_at(
|
||||
bounds,
|
||||
iced::Point::new(bounds.width * 0.5, bounds.height * 0.5),
|
||||
)
|
||||
}
|
||||
|
||||
/// The nearest solid or mesh surface under `local` (relative to `bounds`).
|
||||
@@ -13343,13 +13351,21 @@ pub(crate) fn drop_layout_viewports(document: &mut codec::CadDocument, block: Ha
|
||||
for handle in &viewports {
|
||||
document.remove_entity(*handle);
|
||||
}
|
||||
if let Some(record) = document.block_records.iter_mut().find(|record| record.handle == block) {
|
||||
record.entity_handles.retain(|handle| !viewports.contains(handle));
|
||||
if let Some(record) = document
|
||||
.block_records
|
||||
.iter_mut()
|
||||
.find(|record| record.handle == block)
|
||||
{
|
||||
record
|
||||
.entity_handles
|
||||
.retain(|handle| !viewports.contains(handle));
|
||||
}
|
||||
for object in document.objects.values_mut() {
|
||||
if let ObjectType::Layout(layout) = object {
|
||||
if layout.block_record == block {
|
||||
layout.viewports.retain(|handle| !viewports.contains(handle));
|
||||
layout
|
||||
.viewports
|
||||
.retain(|handle| !viewports.contains(handle));
|
||||
if viewports.contains(&layout.viewport) {
|
||||
layout.viewport = Handle::NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user