|
|
|
|
@ -642,7 +642,14 @@ impl<'a> ObjectsBuilder<'a> {
|
|
|
|
|
Ok(Objects::Ellipse(ellipse))
|
|
|
|
|
}
|
|
|
|
|
EntityType::Line(line) => {
|
|
|
|
|
let mut line: Line = line.into();
|
|
|
|
|
// 获取颜色
|
|
|
|
|
let color = if let Some(aci_index) = self.ent.common.color.index() {
|
|
|
|
|
aci_to_hex_color(aci_index)
|
|
|
|
|
} else {
|
|
|
|
|
HexColor::from_u32(self.ent.common.color_24_bit as u32)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let mut line: Line = Line::from_line_with_color(line, color);
|
|
|
|
|
|
|
|
|
|
// 根据line_type_name更新线型样式
|
|
|
|
|
line.update_line_style(&update_line_style);
|
|
|
|
|
@ -661,7 +668,14 @@ impl<'a> ObjectsBuilder<'a> {
|
|
|
|
|
Ok(Objects::Line(line))
|
|
|
|
|
}
|
|
|
|
|
EntityType::Arc(arc) => {
|
|
|
|
|
let mut arc: Arc = arc.into();
|
|
|
|
|
// 获取颜色
|
|
|
|
|
let color = if let Some(aci_index) = self.ent.common.color.index() {
|
|
|
|
|
aci_to_hex_color(aci_index)
|
|
|
|
|
} else {
|
|
|
|
|
HexColor::from_u32(self.ent.common.color_24_bit as u32)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let mut arc: Arc = Arc::from_arc_with_color(arc, color);
|
|
|
|
|
|
|
|
|
|
// 根据line_type_name更新线型样式
|
|
|
|
|
arc.update_line_style(&update_line_style);
|
|
|
|
|
@ -1352,6 +1366,7 @@ impl From<HorizontalTextJustification> for HAlignment {
|
|
|
|
|
match value {
|
|
|
|
|
HorizontalTextJustification::Left => HAlignment::Left,
|
|
|
|
|
HorizontalTextJustification::Center => HAlignment::Center,
|
|
|
|
|
HorizontalTextJustification::Middle => HAlignment::Center,
|
|
|
|
|
HorizontalTextJustification::Right => HAlignment::Right,
|
|
|
|
|
|
|
|
|
|
//TODO: Handling the Aligned Middle and Fit alignments are a bit more complicated
|
|
|
|
|
@ -1700,6 +1715,8 @@ fn aci_to_rgb(aci: u8) -> (u8, u8, u8) {
|
|
|
|
|
8 => (128, 128, 128), // 深灰色
|
|
|
|
|
9 => (192, 192, 192), // 浅灰色
|
|
|
|
|
94 => (0, 129, 0), // 深绿色
|
|
|
|
|
15 => (129, 86, 86), // 深棕色
|
|
|
|
|
|
|
|
|
|
// 更多标准颜色可以根据需要添加
|
|
|
|
|
_ => (0, 0, 0), // 默认黑色
|
|
|
|
|
}
|
|
|
|
|
|