Replace isComponentsOpen, isSymbolsOpen by SelectorMode in SVG.tsx
This commit is contained in:
parent
579422653b
commit
9797ada55a
2 changed files with 36 additions and 8 deletions
|
@ -8,7 +8,7 @@ import { BAR_WIDTH } from '../Bar/Bar';
|
|||
import { Canvas } from '../Canvas/Canvas';
|
||||
import { AddDimensions } from '../Canvas/DimensionLayer';
|
||||
import { RenderSelector } from '../Canvas/Selector';
|
||||
import { SVG } from '../SVG/SVG';
|
||||
import { SelectorMode, SVG } from '../SVG/SVG';
|
||||
import { RenderSymbol } from '../Canvas/Symbol';
|
||||
import { useState } from 'react';
|
||||
import { type ISymbolModel } from '../../Interfaces/ISymbolModel';
|
||||
|
@ -71,6 +71,13 @@ export function Viewer({
|
|||
return <></>;
|
||||
}
|
||||
|
||||
let selectorMode = SelectorMode.Nothing;
|
||||
if (isComponentsOpen) {
|
||||
selectorMode = SelectorMode.Containers;
|
||||
} else if (isSymbolsOpen) {
|
||||
selectorMode = SelectorMode.Symbols;
|
||||
}
|
||||
|
||||
if (USE_EXPERIMENTAL_CANVAS_API) {
|
||||
function Draw(ctx: CanvasRenderingContext2D, frameCount: number, scale: number, translatePos: IPoint): void {
|
||||
if (mainContainer === undefined) {
|
||||
|
@ -144,9 +151,8 @@ export function Viewer({
|
|||
selectedContainer={selectedContainer}
|
||||
symbols={current.symbols}
|
||||
selectedSymbol={selectedSymbol}
|
||||
selectorMode={selectorMode}
|
||||
selectContainer={selectContainer}
|
||||
isComponentsOpen={isComponentsOpen}
|
||||
isSymbolsOpen={isSymbolsOpen}
|
||||
>
|
||||
{mainContainer}
|
||||
</SVG>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue