forked from 1b-agent/opencadstudio-upstream
feat(cad): integrate standard codec coverage
Render, edit, query, select, and explode newly decoded standard entity variants. Pin acadifc de8d6b5 and preserve None color semantics.
This commit is contained in:
1 parent
34d0c377e2
commit
731df4a725
19 files changed
+484
-72
No files matched your search
@@ -45,6 +45,7 @@ pub fn color_to_aci_string(c: AcadColor) -> String {
|
||||
match c {
|
||||
AcadColor::ByBlock => "0".to_string(),
|
||||
AcadColor::ByLayer => "256".to_string(),
|
||||
AcadColor::None => "257".to_string(),
|
||||
AcadColor::Index(i) => i.to_string(),
|
||||
AcadColor::Rgb { .. } => "256".to_string(),
|
||||
}
|
||||
@@ -55,6 +56,7 @@ pub fn aci_string_to_color(s: &str) -> AcadColor {
|
||||
match s.trim().parse::<i16>().unwrap_or(256) {
|
||||
0 => AcadColor::ByBlock,
|
||||
256 => AcadColor::ByLayer,
|
||||
257 => AcadColor::None,
|
||||
n if (1..=255).contains(&n) => AcadColor::Index(n as u8),
|
||||
_ => AcadColor::ByLayer,
|
||||
}
|
||||
|
||||
@@ -1356,6 +1356,7 @@ fn picker_text_btn(label: &str, msg: Message) -> Element<'_, Message> {
|
||||
/// Returns an (iced::Color swatch_bg, display_label) pair for an AcadColor.
|
||||
pub fn acad_color_display(c: AcadColor) -> (Color, &'static str) {
|
||||
match c {
|
||||
AcadColor::None => (Color::TRANSPARENT, "None"),
|
||||
AcadColor::ByLayer => (
|
||||
Color {
|
||||
r: 0.35,
|
||||
|
||||
@@ -38,6 +38,7 @@ pub fn view_window<'a>(
|
||||
.map(|(idx, e)| {
|
||||
let color_str = match &e.color {
|
||||
acadrust::types::Color::ByLayer => "ByLayer".into(),
|
||||
acadrust::types::Color::None => "None".into(),
|
||||
acadrust::types::Color::ByBlock => "ByBlock".into(),
|
||||
acadrust::types::Color::Index(i) => format!("ACI {i}"),
|
||||
acadrust::types::Color::Rgb { r, g, b } => format!("#{r:02X}{g:02X}{b:02X}"),
|
||||
|
||||
@@ -116,6 +116,7 @@ const COLOR_OPTIONS: &[&str] = &[
|
||||
pub fn color_label(c: AcadColor) -> String {
|
||||
match c {
|
||||
AcadColor::ByLayer => "ByLayer".into(),
|
||||
AcadColor::None => "None".into(),
|
||||
AcadColor::ByBlock => "ByBlock".into(),
|
||||
AcadColor::Index(1) => "Red".into(),
|
||||
AcadColor::Index(2) => "Yellow".into(),
|
||||
|
||||
Reference in new issue
Block a user