forked from 1b-agent/opencadstudio-upstream
style: apply cargo fmt across workspace
This commit is contained in:
1 parent
85710e5454
commit
9cf9ff2c5c
531 files changed
+57740
-33906
No files matched your search
@@ -86,7 +86,12 @@ impl OpenCADStudio {
|
||||
|
||||
self.push_undo_snapshot(i, "PDFIMPORT");
|
||||
let scene = &mut self.tabs[i].scene;
|
||||
if result.dashed && !scene.document.line_types.contains(pdf_import::DASH_LINETYPE) {
|
||||
if result.dashed
|
||||
&& !scene
|
||||
.document
|
||||
.line_types
|
||||
.contains(pdf_import::DASH_LINETYPE)
|
||||
{
|
||||
let mut lt = codec::tables::LineType::new(pdf_import::DASH_LINETYPE);
|
||||
lt.handle = scene.document.allocate_handle();
|
||||
lt.add_element(codec::tables::LineTypeElement::dash(0.8));
|
||||
@@ -106,8 +111,14 @@ impl OpenCADStudio {
|
||||
break;
|
||||
}
|
||||
let file = dir.join(format!("{stem}{:08x}.png", image_file_id(&path, &page, n)));
|
||||
if image::save_buffer(&file, &image.rgba, image.width, image.height, image::ColorType::Rgba8)
|
||||
.is_err()
|
||||
if image::save_buffer(
|
||||
&file,
|
||||
&image.rgba,
|
||||
image.width,
|
||||
image.height,
|
||||
image::ColorType::Rgba8,
|
||||
)
|
||||
.is_err()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -163,10 +174,8 @@ impl OpenCADStudio {
|
||||
.define_block_from_owned_entities(result.entities, &name, glam::DVec3::ZERO)
|
||||
.is_ok()
|
||||
{
|
||||
let mut insert = codec::entities::Insert::new(
|
||||
name,
|
||||
codec::types::Vector3::new(0.0, 0.0, 0.0),
|
||||
);
|
||||
let mut insert =
|
||||
codec::entities::Insert::new(name, codec::types::Vector3::new(0.0, 0.0, 0.0));
|
||||
insert.common.layer = current_layer;
|
||||
scene.add_entity(codec::EntityType::Insert(insert));
|
||||
}
|
||||
@@ -198,7 +207,9 @@ impl OpenCADStudio {
|
||||
scene.document.objects.remove(&definition);
|
||||
for object in scene.document.objects.values_mut() {
|
||||
if let ObjectType::Dictionary(dictionary) = object {
|
||||
dictionary.entries.retain(|(_, target)| *target != definition);
|
||||
dictionary
|
||||
.entries
|
||||
.retain(|(_, target)| *target != definition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user