Skip to content

Commit

Permalink
Feat: Add transparent touch area around symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhutchings committed Mar 15, 2023
1 parent b541317 commit 0a49a8b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/css/shown.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
overflow: visible;
}

.shown defs {
display: none;
}

.shown svg,
.shown text {
fill: currentColor;
Expand Down Expand Up @@ -130,6 +134,11 @@
font-size: 10px;
}

.shown .symbol .touch {
fill: transparent !important;
stroke: none !important;
}

.shown .symbol * {
vector-effect: non-scaling-stroke;
}
11 changes: 10 additions & 1 deletion src/templates/symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ const symbol = (type) => {
class: "symbol",
id: `symbol-${type}`,
viewBox: "0 0 100 100",
})(symbol)
})([
$.rect({
class: "touch",
x: -150,
y: -150,
width: 300,
height: 300,
}),
symbol,
])
}

export default (data) => {
Expand Down

0 comments on commit 0a49a8b

Please sign in to comment.