bg2e-js 2.3.14 → 2.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bg2e-js",
3
- "version": "2.3.14",
3
+ "version": "2.3.15",
4
4
  "description": "a graphics engine for productivity applications",
5
5
  "main": "./dist/bg2e-js.js",
6
6
  "types": "./src/index.ts",
@@ -75,7 +75,9 @@ export default class SelectionManager {
75
75
  }
76
76
 
77
77
  clearSelection() {
78
- this._selection.forEach(item => item.polyList.selected = false);
78
+ this._selection.forEach(item => {
79
+ item.drawable.items.forEach((it: any) => it.polyList.selected = false);
80
+ });
79
81
  this._selection = [];
80
82
  this.triggerSelectionChanged();
81
83
  }
@@ -161,9 +163,6 @@ export default class SelectionManager {
161
163
  const isSelected = () => this._selection.find(s => {
162
164
  return item && s.polyList === item.polyList && s.drawable === item.drawable
163
165
  });
164
- if (item && this.selectionMode === SelectionMode.OBJECT) {
165
- item.drawable.items.forEach(it => it.polyList.selected = true);
166
- }
167
166
 
168
167
  if (item && this._multiSelect && !isSelected()) {
169
168
  this._selection.push(item);
@@ -173,11 +172,22 @@ export default class SelectionManager {
173
172
  this._selection = [item];
174
173
  this.triggerSelectionChanged();
175
174
  }
176
- else if (!item && !this._multiSelect && this._selection.length > 0) {
175
+ else if (item && this._multiSelect && isSelected()) {
176
+ this._selection = this._selection.filter(s => !(s.polyList === item.polyList));
177
+ this.triggerSelectionChanged();
178
+ }
179
+ else if (!item && this._selection.length > 0) {
177
180
  this._selection = [];
178
181
  this.triggerSelectionChanged();
179
182
  }
180
183
 
184
+ if (this.selectionMode === SelectionMode.OBJECT) {
185
+ this._selection.forEach(item => {
186
+ item.drawable.items.forEach((it: any) => it.polyList.selected = true);
187
+ });
188
+ //item.drawable.items.forEach(it => it.polyList.selected = true);
189
+ }
190
+
181
191
  this._selection.forEach(item => item.polyList.selected = true);
182
192
  }
183
193
  }