Skip to content

Commit

Permalink
fix(drawing): use set to save sigle active type
Browse files Browse the repository at this point in the history
  • Loading branch information
VicKun4937 committed Oct 26, 2024
1 parent d2f4f77 commit a3cb28b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/engine-render/src/scene.transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ const MINI_HEIGHT_LIMIT = 20;

const DEFAULT_CONTROL_PLUS_INDEX = 5000;

const SINGLE_ACTIVE_OBJECT_TYPE_MAP= new Set<ObjectType>([

Check failure on line 99 in packages/engine-render/src/scene.transformer.ts

View workflow job for this annotation

GitHub Actions / eslint

Operator '=' must be spaced
ObjectType.CHART,
]);

/**
* Transformer constructor. Transformer is a special type of group that allow you transform
* primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
Expand Down Expand Up @@ -1637,7 +1641,7 @@ export class Transformer extends Disposable implements ITransformerConfig {
return;
}

if (!evt.ctrlKey || applyObject.objectType === ObjectType.CHART) {
if (!evt.ctrlKey || SINGLE_ACTIVE_OBJECT_TYPE_MAP.has(applyObject.objectType)) {
this._selectedObjectMap.clear();
this._clearControlMap();
}
Expand Down

0 comments on commit a3cb28b

Please sign in to comment.