feat(minimap): add offsetScale and selected class name
This commit is contained in:
@@ -58,7 +58,8 @@ function MiniMap({
|
||||
zoomable = false,
|
||||
ariaLabel = 'React Flow mini map',
|
||||
inversePan,
|
||||
zoomStep,
|
||||
zoomStep = 10,
|
||||
offsetScale = 5,
|
||||
}: MiniMapProps) {
|
||||
const store = useStoreApi();
|
||||
const svg = useRef<SVGSVGElement>(null);
|
||||
@@ -70,7 +71,7 @@ function MiniMap({
|
||||
const viewScale = Math.max(scaledWidth, scaledHeight);
|
||||
const viewWidth = viewScale * elementWidth;
|
||||
const viewHeight = viewScale * elementHeight;
|
||||
const offset = 5 * viewScale;
|
||||
const offset = offsetScale * viewScale;
|
||||
const x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;
|
||||
const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;
|
||||
const width = viewWidth + offset * 2;
|
||||
|
||||
Reference in New Issue
Block a user