Fix style of NpThroughHole pad drills
Some checks are pending
test / test (push) Waiting to run

This commit is contained in:
Lily Rose 2025-07-28 18:08:44 +10:00
parent 40cfdf9bc6
commit 71ffecc2d5

View file

@ -2,6 +2,7 @@ import gleam/float
import gleam/list
import gleam/option.{None, Some}
import gleam/order
import gleam/string
import kicad_sexpr
import kicad_sexpr/token.{type Footprint, type Pad}
import lustre/attribute.{style} as _attribute
@ -189,8 +190,8 @@ fn create_svg(footprint: Footprint) -> String {
transform:,
children: footprint.pads
|> list.filter(fn(pad) {
pad.layers |> list.contains(token.Layer("F.Cu"))
|| pad.layers |> list.contains(token.Layer("*.Cu"))
pad.layers
|> list.any(fn(layer) { layer.layer |> string.ends_with(".Cu") })
})
|> list.map(pad_to_element),
),
@ -561,9 +562,11 @@ fn pad_to_element(pad: Pad) -> Element(a) {
)
}
}
let fill = Some(bg_col)
let stroke = Some("#E7B629")
let stroke_width = Some(0.03333)
let #(fill, stroke, stroke_width) = case pad.type_ {
token.ThroughHolePadType -> #(Some(bg_col), Some("#E7B629"), Some(0.03333))
token.NpThroughHolePadType -> #(Some("#18C7D6"), None, None)
_ -> #(None, None, None)
}
case pad.drill {
Some(token.PadDrillDefinition(False, Some(d), ..))
| Some(token.PadDrillDefinition(True, Some(d), None, ..)) ->