Merge branch 'Fix_minimap' into main

This commit is contained in:
Coen
2021-04-15 14:09:35 +02:00
2 changed files with 7 additions and 0 deletions
@@ -9,6 +9,7 @@ interface MiniMapNodeProps {
borderRadius: number;
className: string;
color: string;
shapeRendering: string;
strokeColor: string;
strokeWidth: number;
style?: CSSProperties;
@@ -25,6 +26,7 @@ const MiniMapNode = ({
strokeWidth,
className,
borderRadius,
shapeRendering
}: MiniMapNodeProps) => {
const { background, backgroundColor } = style || {};
const fill = (color || background || backgroundColor) as string;
@@ -41,6 +43,7 @@ const MiniMapNode = ({
fill={fill}
stroke={strokeColor}
strokeWidth={strokeWidth}
shapeRendering={shapeRendering}
/>
);
};
@@ -17,6 +17,8 @@ export interface MiniMapProps extends HTMLAttributes<SVGSVGElement> {
maskColor?: string;
}
declare const window: any;
const defaultWidth = 200;
const defaultHeight = 150;
@@ -62,6 +64,7 @@ const MiniMap = ({
const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;
const width = viewWidth + offset * 2;
const height = viewHeight + offset * 2;
const shapeRendering = !!window.chrome ? "crispEdges" : "geometricPrecision";
return (
<svg
@@ -86,6 +89,7 @@ const MiniMap = ({
borderRadius={nodeBorderRadius}
strokeColor={nodeStrokeColorFunc(node)}
strokeWidth={nodeStrokeWidth}
shapeRendering={shapeRendering}
/>
))}
<path