added css variables for minimap mask, set default mask-stroke to 0
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
export let bgColor: $$Props['bgColor'] = undefined;
|
||||
export let maskColor: $$Props['maskColor'] = undefined;
|
||||
export let maskStrokeColor: $$Props['maskStrokeColor'] = undefined;
|
||||
export let maskStrokeWidth: $$Props['maskStrokeWidth'] = 1;
|
||||
export let maskStrokeWidth: $$Props['maskStrokeWidth'] = undefined;
|
||||
export let width: $$Props['width'] = undefined;
|
||||
export let height: $$Props['height'] = undefined;
|
||||
export let pannable: $$Props['pannable'] = true;
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
<Panel
|
||||
{position}
|
||||
style={style + `;--xy-minimap-background-color-props:${bgColor}`}
|
||||
style={style + (bgColor ? `;--xy-minimap-background-color-props:${bgColor}` : '')}
|
||||
class={cc(['svelte-flow__minimap', className])}
|
||||
data-testid="svelte-flow__minimap"
|
||||
>
|
||||
@@ -96,6 +96,8 @@
|
||||
role="img"
|
||||
aria-labelledby={labelledBy}
|
||||
style:--xy-minimap-mask-background-color-props={maskColor}
|
||||
style:--xy-minimap-mask-stroke-color-props={maskStrokeColor}
|
||||
style:--xy-minimap-mask-stroke-width-props={(maskStrokeWidth ?? 0) * viewScale}
|
||||
use:interactive={{
|
||||
panZoom: $panZoom,
|
||||
viewport,
|
||||
@@ -135,8 +137,6 @@
|
||||
offset * 2}h{-viewboxWidth - offset * 2}z
|
||||
M{viewBB.x},{viewBB.y}h{viewBB.width}v{viewBB.height}h{-viewBB.width}z"
|
||||
fill-rule="evenodd"
|
||||
stroke={maskStrokeColor}
|
||||
stroke-width={maskStrokeWidth ?? 1 * viewScale}
|
||||
pointer-events="none"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user