diff --git a/src/qelmt/line.rs b/src/qelmt/line.rs index 936a237..9f02082 100644 --- a/src/qelmt/line.rs +++ b/src/qelmt/line.rs @@ -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)); - } - } diff --git a/src/qelmt/mod.rs b/src/qelmt/mod.rs index 7654aa3..ab19b02 100644 --- a/src/qelmt/mod.rs +++ b/src/qelmt/mod.rs @@ -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 { diff --git a/src/qelmt/polygon.rs b/src/qelmt/polygon.rs index 79f1619..2ececcc 100644 --- a/src/qelmt/polygon.rs +++ b/src/qelmt/polygon.rs @@ -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 {