fix: scope --color-selection
retrieval to given instance (#6886)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
991f5570ce
commit
1bd416002c
@ -1226,6 +1226,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<InteractiveCanvas
|
<InteractiveCanvas
|
||||||
|
containerRef={this.excalidrawContainerRef}
|
||||||
canvas={this.interactiveCanvas}
|
canvas={this.interactiveCanvas}
|
||||||
elements={canvasElements}
|
elements={canvasElements}
|
||||||
visibleElements={visibleElements}
|
visibleElements={visibleElements}
|
||||||
|
@ -16,6 +16,7 @@ import type {
|
|||||||
import type { NonDeletedExcalidrawElement } from "../../element/types";
|
import type { NonDeletedExcalidrawElement } from "../../element/types";
|
||||||
|
|
||||||
type InteractiveCanvasProps = {
|
type InteractiveCanvasProps = {
|
||||||
|
containerRef: React.RefObject<HTMLDivElement>;
|
||||||
canvas: HTMLCanvasElement | null;
|
canvas: HTMLCanvasElement | null;
|
||||||
elements: readonly NonDeletedExcalidrawElement[];
|
elements: readonly NonDeletedExcalidrawElement[];
|
||||||
visibleElements: readonly NonDeletedExcalidrawElement[];
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
||||||
@ -105,9 +106,12 @@ const InteractiveCanvas = (props: InteractiveCanvasProps) => {
|
|||||||
cursorButton[socketId] = user.button;
|
cursorButton[socketId] = user.button;
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectionColor = getComputedStyle(
|
const selectionColor =
|
||||||
document.querySelector(".excalidraw")!,
|
(props.containerRef?.current &&
|
||||||
).getPropertyValue("--color-selection");
|
getComputedStyle(props.containerRef.current).getPropertyValue(
|
||||||
|
"--color-selection",
|
||||||
|
)) ||
|
||||||
|
"#6965db";
|
||||||
|
|
||||||
renderInteractiveScene(
|
renderInteractiveScene(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user