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
+20
-29
@@ -43,10 +43,9 @@ impl Scene {
|
||||
}
|
||||
}
|
||||
AreaPreviewSource::Boundary(boundary) => {
|
||||
if let Some(model) = Self::area_preview_hatch(
|
||||
std::slice::from_ref(boundary),
|
||||
region.subtract,
|
||||
) {
|
||||
if let Some(model) =
|
||||
Self::area_preview_hatch(std::slice::from_ref(boundary), region.subtract)
|
||||
{
|
||||
models.push(model);
|
||||
}
|
||||
}
|
||||
@@ -67,11 +66,8 @@ impl Scene {
|
||||
return;
|
||||
}
|
||||
|
||||
let direct_boundary = crate::scene::project::clip_boundary_polygon_for_document(
|
||||
&self.document,
|
||||
handle,
|
||||
0.0,
|
||||
);
|
||||
let direct_boundary =
|
||||
crate::scene::project::clip_boundary_polygon_for_document(&self.document, handle, 0.0);
|
||||
let mut rings = if direct_boundary.len() >= 3 {
|
||||
vec![direct_boundary
|
||||
.into_iter()
|
||||
@@ -110,12 +106,18 @@ impl Scene {
|
||||
|
||||
fn push_area_preview_ring(rings: &mut Vec<Vec<[f64; 2]>>, ring: &mut Vec<[f64; 2]>) {
|
||||
if ring.len() >= 3 {
|
||||
let min_x = ring.iter().map(|point| point[0]).fold(f64::INFINITY, f64::min);
|
||||
let min_x = ring
|
||||
.iter()
|
||||
.map(|point| point[0])
|
||||
.fold(f64::INFINITY, f64::min);
|
||||
let max_x = ring
|
||||
.iter()
|
||||
.map(|point| point[0])
|
||||
.fold(f64::NEG_INFINITY, f64::max);
|
||||
let min_y = ring.iter().map(|point| point[1]).fold(f64::INFINITY, f64::min);
|
||||
let min_y = ring
|
||||
.iter()
|
||||
.map(|point| point[1])
|
||||
.fold(f64::INFINITY, f64::min);
|
||||
let max_y = ring
|
||||
.iter()
|
||||
.map(|point| point[1])
|
||||
@@ -221,8 +223,7 @@ impl Scene {
|
||||
if let EntityType::Hatch(hatch) = entity {
|
||||
if let Some(background) = crate::entities::hatch::background_color(hatch) {
|
||||
let mut backdrop = model.clone();
|
||||
backdrop.pattern =
|
||||
crate::scene::model::hatch_model::HatchPattern::Solid;
|
||||
backdrop.pattern = crate::scene::model::hatch_model::HatchPattern::Solid;
|
||||
let (background_color, background_aci) = match background {
|
||||
codec::types::Color::ByLayer => {
|
||||
let layer = self.document.layers.get(&hatch.common.layer);
|
||||
@@ -243,15 +244,12 @@ impl Scene {
|
||||
}
|
||||
codec::types::Color::ByBlock => (style.0, style.4),
|
||||
codec::types::Color::Index(index) => (
|
||||
crate::scene::convert::tess_util::aci_to_rgba(
|
||||
&codec::types::Color::Index(index),
|
||||
),
|
||||
crate::scene::convert::tess_util::aci_to_rgba(&codec::types::Color::Index(
|
||||
index,
|
||||
)),
|
||||
index,
|
||||
),
|
||||
other => (
|
||||
crate::scene::convert::tess_util::aci_to_rgba(&other),
|
||||
0,
|
||||
),
|
||||
other => (crate::scene::convert::tess_util::aci_to_rgba(&other), 0),
|
||||
};
|
||||
backdrop.color = background_color;
|
||||
backdrop.aci = background_aci;
|
||||
@@ -294,9 +292,7 @@ impl Scene {
|
||||
// show the shape following the cursor. Build a live boundary
|
||||
// from the current HatchModel — `apply_grip` keeps it in
|
||||
// step, so the preview tracks a dragged grip in real time.
|
||||
Some(EntityType::Hatch(_)) => {
|
||||
self.hatch_outline_wire(*h).into_iter().collect()
|
||||
}
|
||||
Some(EntityType::Hatch(_)) => self.hatch_outline_wire(*h).into_iter().collect(),
|
||||
Some(e) => self.tessellate_one(e),
|
||||
None => Vec::new(),
|
||||
}
|
||||
@@ -390,12 +386,7 @@ impl Scene {
|
||||
if pts.len() < 2 {
|
||||
return None;
|
||||
}
|
||||
let mut wire = WireModel::solid_f64(
|
||||
handle.value().to_string(),
|
||||
pts,
|
||||
m.color,
|
||||
false,
|
||||
);
|
||||
let mut wire = WireModel::solid_f64(handle.value().to_string(), pts, m.color, false);
|
||||
wire.aci = m.aci;
|
||||
wire.line_weight_px = m.line_weight_px;
|
||||
Some(wire)
|
||||
|
||||
Reference in new issue
Block a user