qdj
邱德佳 4 months ago
parent 1735d04ae4
commit 55740501d0

@ -99,22 +99,6 @@ impl Line {
})
}
pub fn update_line_weight(&mut self, lw: i16) {
let weight_str = match lw {
0 | -1 => "thin",
13..=25 => "thin",
26..=70 => "normal",
71..=100 => "thick",
_ => "extra-thick",
};
// 直接追加,不做复杂替换(简单有效)
if !self.style.is_empty() {
self.style.push_str("; ");
}
self.style.push_str(&format!("line-weight: {}", weight_str));
}
}

@ -828,7 +828,6 @@ impl<'a> ObjectsBuilder<'a> {
if let Ok(mut ellipse) = Ellipse::try_from(polyline) {
// 根据line_type_name更新线型样式
ellipse.update_line_style(&update_line_style);
// TODO ellipse的粗体未实现
ellipse.scale(self.scale_fact.x, self.scale_fact.y);
ellipse.x += self.offset.x;
@ -840,7 +839,6 @@ impl<'a> ObjectsBuilder<'a> {
// 根据line_type_name更新线型样式
poly.update_line_style(&update_line_style);
// TODO poly的粗体未实现
poly.scale(self.scale_fact.x, self.scale_fact.y);
for cord in &mut poly.coordinates {
@ -901,10 +899,6 @@ impl<'a> ObjectsBuilder<'a> {
// 根据line_type_name更新线型样式
line.update_line_style(&update_line_style);
// 更新线条粗细
if let Some(w) = lw {
line.update_line_weight(w);
}
line.scale(self.scale_fact.x, self.scale_fact.y);
line.x1 += self.offset.x;
@ -919,7 +913,6 @@ impl<'a> ObjectsBuilder<'a> {
if let Ok(mut ellipse) = Ellipse::try_from_lwpolyline_with_color(lwpolyline, color) {
// 根据line_type_name更新线型样式
ellipse.update_line_style(&update_line_style);
// TODO ellipse的粗体未实现
ellipse.scale(self.scale_fact.x, self.scale_fact.y);
ellipse.x += self.offset.x;
@ -954,7 +947,6 @@ impl<'a> ObjectsBuilder<'a> {
// 根据line_type_name更新线型样式
poly.update_line_style(&update_line_style);
// TODO poly的粗体未实现
poly.scale(self.scale_fact.x, self.scale_fact.y);
for cord in &mut poly.coordinates {

@ -107,24 +107,6 @@ impl Polygon {
},
}
}
pub fn update_line_weight(&mut self, lw: i16) {
let weight_str = match lw {
0 | -1 => "thin",
13..=25 => "thin",
26..=70 => "normal",
71..=100 => "thick",
_ => "extra-thick",
};
// 直接追加,不做复杂替换(简单有效)
if !self.style.is_empty() {
self.style.push_str("; ");
}
self.style.push_str(&format!("line-weight: {}", weight_str));
}
}
impl From<(&Spline, u32)> for Polygon {

Loading…
Cancel
Save