Skip to content

Commit d264796

Browse files
committed
fix(draw): render fill as none when fill is transparent #WIK-19978
1 parent edaf62b commit d264796

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.changeset/sour-spiders-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@plait/draw': minor
3+
---
4+
5+
render fill as none when fill is transparent

packages/draw/src/utils/style/stroke.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DefaultDrawStyle } from '../../constants';
33
import { PlaitBoard, PlaitElement } from '@plait/core';
44
import { getDrawDefaultStrokeColor, getFlowchartDefaultFill } from '../geometry';
55
import { isClosedDrawElement } from '../common';
6-
import { StrokeStyle } from '@plait/common';
6+
import { StrokeStyle, TRANSPARENT } from '@plait/common';
77

88
export const getStrokeColorByElement = (board: PlaitBoard, element: PlaitElement) => {
99
const defaultColor = getDrawDefaultStrokeColor(board.theme.themeColorMode);
@@ -16,7 +16,9 @@ export const getFillByElement = (board: PlaitBoard, element: PlaitElement) => {
1616
PlaitDrawElement.isFlowchart(element) && isClosedDrawElement(element as PlaitDrawElement)
1717
? getFlowchartDefaultFill(board.theme.themeColorMode)
1818
: DefaultDrawStyle.fill;
19-
const fill = element.fill || defaultFill;
19+
const currentFill =
20+
element.fill && (element.fill === TRANSPARENT || element.fill === TRANSPARENT.toUpperCase()) ? DefaultDrawStyle.fill : element.fill;
21+
const fill = currentFill || defaultFill;
2022
return fill;
2123
};
2224

0 commit comments

Comments
 (0)