mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-03 05:10:13 -05:00
Fixed arrows strokecaps (#68)
* fixed arrows strokecaps * fixed arrows strokecaps
This commit is contained in:
parent
b298dc6f85
commit
92e0b6f026
2 changed files with 9 additions and 4 deletions
5
.changeset/nervous-camels-reflect.md
Normal file
5
.changeset/nervous-camels-reflect.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"penpot-exporter": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixed strokecaps for arrows that were showing even when not configured in figma
|
|
@ -18,7 +18,7 @@ export const translateStrokes = (
|
||||||
strokeStyle: nodeStrokes.dashPattern.length ? 'dashed' : 'solid'
|
strokeStyle: nodeStrokes.dashPattern.length ? 'dashed' : 'solid'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!hasFillGeometry && index === 0 && vectorNetwork && vectorNetwork.vertices.length) {
|
if (!hasFillGeometry && index === 0 && vectorNetwork && vectorNetwork.vertices.length > 0) {
|
||||||
stroke.strokeCapStart = translateStrokeCap(vectorNetwork.vertices[0]);
|
stroke.strokeCapStart = translateStrokeCap(vectorNetwork.vertices[0]);
|
||||||
stroke.strokeCapEnd = translateStrokeCap(
|
stroke.strokeCapEnd = translateStrokeCap(
|
||||||
vectorNetwork.vertices[vectorNetwork.vertices.length - 1]
|
vectorNetwork.vertices[vectorNetwork.vertices.length - 1]
|
||||||
|
@ -64,8 +64,6 @@ const translateStrokeAlignment = (
|
||||||
|
|
||||||
const translateStrokeCap = (vertex: VectorVertex): StrokeCaps | undefined => {
|
const translateStrokeCap = (vertex: VectorVertex): StrokeCaps | undefined => {
|
||||||
switch (vertex.strokeCap as StrokeCap | ConnectorStrokeCap) {
|
switch (vertex.strokeCap as StrokeCap | ConnectorStrokeCap) {
|
||||||
case 'NONE':
|
|
||||||
return;
|
|
||||||
case 'ROUND':
|
case 'ROUND':
|
||||||
return 'round';
|
return 'round';
|
||||||
case 'ARROW_EQUILATERAL':
|
case 'ARROW_EQUILATERAL':
|
||||||
|
@ -78,7 +76,9 @@ const translateStrokeCap = (vertex: VectorVertex): StrokeCaps | undefined => {
|
||||||
case 'DIAMOND_FILLED':
|
case 'DIAMOND_FILLED':
|
||||||
return 'diamond-marker';
|
return 'diamond-marker';
|
||||||
case 'ARROW_LINES':
|
case 'ARROW_LINES':
|
||||||
default:
|
|
||||||
return 'line-arrow';
|
return 'line-arrow';
|
||||||
|
case 'NONE':
|
||||||
|
default:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue