Skip to content

Commit

Permalink
change trace color on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Nov 14, 2024
1 parent 265fcd7 commit 094cecb
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 13 deletions.
4 changes: 3 additions & 1 deletion lib/sch/convert-circuit-json-to-schematic-svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ export function convertCircuitJsonToSchematicSvg(
.component { fill: none; stroke: ${colorMap.schematic.component_outline}; }
.chip { fill: ${colorMap.schematic.component_body}; stroke: ${colorMap.schematic.component_outline}; }
.component-pin { fill: none; stroke: ${colorMap.schematic.component_outline}; }
.trace { stroke: ${colorMap.schematic.wire}; }
.trace:hover {
filter: invert(1);
}
.text { font-family: sans-serif; fill: ${colorMap.schematic.wire}; }
.pin-number { fill: ${colorMap.schematic.pin_number}; }
.port-label { fill: ${colorMap.schematic.reference}; }
Expand Down
13 changes: 11 additions & 2 deletions lib/sch/svg-object-fns/create-svg-objects-from-sch-trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export function createSchematicTrace(
name: "path",
type: "element",
attributes: {
class: "trace",
d: path,
stroke: colorMap.schematic.wire,
fill: "none",
Expand Down Expand Up @@ -137,5 +136,15 @@ export function createSchematicTrace(
}
}

return svgObjects
return [
{
name: "g",
type: "element",
value: "",
attributes: {
class: "trace",
},
children: svgObjects,
},
]
}
4 changes: 3 additions & 1 deletion tests/sch/__snapshots__/debug-object.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion tests/sch/__snapshots__/grid-and-points.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions tests/sch/__snapshots__/kicad-theme-demo.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion tests/sch/__snapshots__/net-label.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion tests/sch/__snapshots__/resistor.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion tests/sch/__snapshots__/rotated-resistor.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions tests/sch/__snapshots__/trace-overlap.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion tests/sch/__snapshots__/unknown-symbol.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 094cecb

Please sign in to comment.