@idraw/core 0.4.0-beta.36 → 0.4.0-beta.38

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.
@@ -1272,6 +1272,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1272
1272
  _loop(elements);
1273
1273
  return positionMap;
1274
1274
  }
1275
+ function isSameElementSize(elem1, elem2) {
1276
+ return elem1.x === elem2.x && elem1.y === elem2.y && elem1.h === elem2.h && elem1.w === elem2.w && limitAngle(elem1.angle || 0) === limitAngle(elem2.angle || 0);
1277
+ }
1275
1278
  function getElementVertexes(elemSize) {
1276
1279
  const { x: x2, y: y2, h: h2, w: w2 } = elemSize;
1277
1280
  return [
@@ -1755,6 +1758,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1755
1758
  });
1756
1759
  const rotateVertexes2 = calcElementVertexes(rotateSize);
1757
1760
  const sizeController = {
1761
+ originalElementCenter: calcElementCenter(elemSize),
1762
+ originalElementSize: Object.assign({}, elemSize),
1758
1763
  elementWrapper: vertexes,
1759
1764
  left: {
1760
1765
  type: "left",
@@ -2142,6 +2147,31 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2142
2147
  }
2143
2148
  return t;
2144
2149
  });
2150
+ function calcPointMoveElementInGroup(start, end, groupQueue) {
2151
+ let moveX = end.x - start.x;
2152
+ let moveY = end.y - start.y;
2153
+ const pointGroupQueue = [];
2154
+ groupQueue.forEach((group) => {
2155
+ const { x: x2, y: y2, w: w2, h: h2, angle: angle2 = 0 } = group;
2156
+ pointGroupQueue.push({
2157
+ x: x2,
2158
+ y: y2,
2159
+ w: w2,
2160
+ h: h2,
2161
+ angle: 0 - angle2
2162
+ });
2163
+ });
2164
+ if ((groupQueue === null || groupQueue === void 0 ? void 0 : groupQueue.length) > 0) {
2165
+ const startInGroup = rotatePointInGroup(start, pointGroupQueue);
2166
+ const endInGroup = rotatePointInGroup(end, pointGroupQueue);
2167
+ moveX = endInGroup.x - startInGroup.x;
2168
+ moveY = endInGroup.y - startInGroup.y;
2169
+ }
2170
+ return {
2171
+ moveX,
2172
+ moveY
2173
+ };
2174
+ }
2145
2175
  function createColorStyle(ctx, color2, opts) {
2146
2176
  if (typeof color2 === "string") {
2147
2177
  return color2;
@@ -4792,6 +4822,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
4792
4822
  }
4793
4823
  }
4794
4824
  function drawSelectedElementControllersVertexes(ctx, controller, opts) {
4825
+ var _a;
4795
4826
  if (!controller) {
4796
4827
  return;
4797
4828
  }
@@ -4799,8 +4830,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
4799
4830
  hideControllers,
4800
4831
  style,
4801
4832
  rotateControllerPattern,
4802
- viewSizeInfo
4803
- // calculator, element, viewScaleInfo, viewSizeInfo
4833
+ viewSizeInfo,
4834
+ element
4835
+ // calculator, viewScaleInfo, viewSizeInfo
4804
4836
  } = opts;
4805
4837
  const { devicePixelRatio = 1 } = viewSizeInfo;
4806
4838
  const { activeColor: activeColor2 } = style;
@@ -4813,19 +4845,21 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
4813
4845
  drawVertexes(ctx, calcViewVertexes(topRight.vertexes, opts), ctrlOpts);
4814
4846
  drawVertexes(ctx, calcViewVertexes(bottomLeft.vertexes, opts), ctrlOpts);
4815
4847
  drawVertexes(ctx, calcViewVertexes(bottomRight.vertexes, opts), ctrlOpts);
4816
- drawCircleController(ctx, calcViewPointSize(rotate.center, opts), { ...ctrlOpts, size: rotate.size, borderWidth: 0 });
4817
- const rotateCenter = calcViewPointSize(rotate.center, opts);
4818
- ctx.drawImage(
4819
- rotateControllerPattern.canvas,
4820
- 0,
4821
- 0,
4822
- rotateControllerPattern.canvas.width / devicePixelRatio,
4823
- rotateControllerPattern.canvas.height / devicePixelRatio,
4824
- rotateCenter.x - rotate.size / 2,
4825
- rotateCenter.y - rotate.size / 2,
4826
- rotate.size,
4827
- rotate.size
4828
- );
4848
+ if (((_a = element == null ? void 0 : element.operations) == null ? void 0 : _a.rotatable) !== false) {
4849
+ drawCircleController(ctx, calcViewPointSize(rotate.center, opts), { ...ctrlOpts, size: rotate.size, borderWidth: 0 });
4850
+ const rotateCenter = calcViewPointSize(rotate.center, opts);
4851
+ ctx.drawImage(
4852
+ rotateControllerPattern.canvas,
4853
+ 0,
4854
+ 0,
4855
+ rotateControllerPattern.canvas.width / devicePixelRatio,
4856
+ rotateControllerPattern.canvas.height / devicePixelRatio,
4857
+ rotateCenter.x - rotate.size / 2,
4858
+ rotateCenter.y - rotate.size / 2,
4859
+ rotate.size,
4860
+ rotate.size
4861
+ );
4862
+ }
4829
4863
  }
4830
4864
  }
4831
4865
  function drawArea(ctx, opts) {
@@ -4940,7 +4974,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
4940
4974
  return isPointInViewActiveVertexes(p, { ctx, vertexes, viewScaleInfo, viewSizeInfo });
4941
4975
  }
4942
4976
  function getPointTarget(p, opts) {
4943
- var _a, _b, _c;
4977
+ var _a, _b, _c, _d, _e;
4944
4978
  const target = {
4945
4979
  type: null,
4946
4980
  elements: [],
@@ -4951,7 +4985,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
4951
4985
  const { ctx, data, calculator, selectedElements, viewScaleInfo, viewSizeInfo, areaSize, groupQueue, selectedElementController } = opts;
4952
4986
  if (selectedElementController) {
4953
4987
  const { left, right, top, bottom, topLeft, topRight, bottomLeft, bottomRight, rotate } = selectedElementController;
4954
- const ctrls = [left, right, top, bottom, topLeft, topRight, bottomLeft, bottomRight, rotate];
4988
+ const ctrls = [left, right, top, bottom, topLeft, topRight, bottomLeft, bottomRight];
4989
+ if ((selectedElements == null ? void 0 : selectedElements.length) === 1 && ((_b = (_a = selectedElements == null ? void 0 : selectedElements[0]) == null ? void 0 : _a.operations) == null ? void 0 : _b.rotatable) !== false) {
4990
+ ctrls.push(rotate);
4991
+ }
4955
4992
  for (let i = 0; i < ctrls.length; i++) {
4956
4993
  const ctrl = ctrls[i];
4957
4994
  if (isPointInViewActiveVertexes(p, { ctx, vertexes: ctrl.vertexes, viewSizeInfo, viewScaleInfo })) {
@@ -4966,7 +5003,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
4966
5003
  }
4967
5004
  if (groupQueue && Array.isArray(groupQueue) && groupQueue.length > 0) {
4968
5005
  const lastGroup = groupQueue[groupQueue.length - 1];
4969
- if (((_a = lastGroup == null ? void 0 : lastGroup.detail) == null ? void 0 : _a.children) && Array.isArray((_b = lastGroup == null ? void 0 : lastGroup.detail) == null ? void 0 : _b.children)) {
5006
+ if (((_c = lastGroup == null ? void 0 : lastGroup.detail) == null ? void 0 : _c.children) && Array.isArray((_d = lastGroup == null ? void 0 : lastGroup.detail) == null ? void 0 : _d.children)) {
4970
5007
  for (let i = lastGroup.detail.children.length - 1; i >= 0; i--) {
4971
5008
  const child = lastGroup.detail.children[i];
4972
5009
  const vertexes = calcElementVertexesInGroup(child, { groupQueue });
@@ -4995,7 +5032,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
4995
5032
  }
4996
5033
  if (data) {
4997
5034
  const { index, element } = calculator.getPointElement(p, { data, viewScaleInfo, viewSizeInfo });
4998
- if (index >= 0 && element && ((_c = element == null ? void 0 : element.operations) == null ? void 0 : _c.invisible) !== true) {
5035
+ if (index >= 0 && element && ((_e = element == null ? void 0 : element.operations) == null ? void 0 : _e.invisible) !== true) {
4999
5036
  target.elements = [element];
5000
5037
  target.type = "over-element";
5001
5038
  return target;
@@ -5643,31 +5680,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
5643
5680
  }
5644
5681
  return false;
5645
5682
  }
5646
- function calcMoveInGroup(start, end, groupQueue) {
5647
- let moveX = end.x - start.x;
5648
- let moveY = end.y - start.y;
5649
- const pointGroupQueue = [];
5650
- groupQueue.forEach((group) => {
5651
- const { x: x2, y: y2, w: w2, h: h2, angle: angle2 = 0 } = group;
5652
- pointGroupQueue.push({
5653
- x: x2,
5654
- y: y2,
5655
- w: w2,
5656
- h: h2,
5657
- angle: 0 - angle2
5658
- });
5659
- });
5660
- if ((groupQueue == null ? void 0 : groupQueue.length) > 0) {
5661
- const startInGroup = rotatePointInGroup(start, pointGroupQueue);
5662
- const endInGroup = rotatePointInGroup(end, pointGroupQueue);
5663
- moveX = endInGroup.x - startInGroup.x;
5664
- moveY = endInGroup.y - startInGroup.y;
5665
- }
5666
- return {
5667
- moveX,
5668
- moveY
5669
- };
5670
- }
5671
5683
  const unitSize = 2;
5672
5684
  function getViewBoxInfo(rectInfo) {
5673
5685
  const boxInfo = {
@@ -5932,8 +5944,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
5932
5944
  const keyLayoutActionType = Symbol(`${key$2}_layoutActionType`);
5933
5945
  const keyLayoutControlType = Symbol(`${key$2}_layoutControlType`);
5934
5946
  const keyLayoutController = Symbol(`${key$2}_layoutController`);
5935
- const keyLayoutIsHover = Symbol(`${key$2}_layoutIsHover`);
5947
+ const keyLayoutIsHoverContent = Symbol(`${key$2}_layoutIsHoverContent`);
5948
+ const keyLayoutIsHoverController = Symbol(`${key$2}_layoutIsHoverController`);
5936
5949
  const keyLayoutIsSelected = Symbol(`${key$2}_layoutIsSelected`);
5950
+ const keyLayoutIsBusyMoving = Symbol(`${key$2}_layoutIsSelected`);
5937
5951
  const controllerSize = 10;
5938
5952
  const defaultStyle$2 = {
5939
5953
  activeColor: "#b331c9"
@@ -6011,27 +6025,19 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6011
6025
  const { activeColor: activeColor2 } = innerConfig;
6012
6026
  const style = { activeColor: activeColor2 };
6013
6027
  let prevPoint = null;
6014
- let prevIsHover = null;
6028
+ let prevIsHoverContent = null;
6015
6029
  let prevIsSelected = null;
6016
- let isBusy = null;
6017
6030
  const clear = () => {
6018
6031
  prevPoint = null;
6019
6032
  sharer.setSharedStorage(keyLayoutActionType, null);
6020
6033
  sharer.setSharedStorage(keyLayoutControlType, null);
6021
6034
  sharer.setSharedStorage(keyLayoutController, null);
6022
- sharer.setSharedStorage(keyLayoutIsHover, null);
6035
+ sharer.setSharedStorage(keyLayoutIsHoverContent, null);
6036
+ sharer.setSharedStorage(keyLayoutIsHoverController, null);
6023
6037
  sharer.setSharedStorage(keyLayoutIsSelected, null);
6024
- prevIsHover = null;
6038
+ sharer.setSharedStorage(keyLayoutIsBusyMoving, null);
6039
+ prevIsHoverContent = null;
6025
6040
  prevIsSelected = null;
6026
- isBusy = null;
6027
- };
6028
- const isInElementHover = () => {
6029
- const hoverElement = sharer.getSharedStorage(keyHoverElement);
6030
- if (hoverElement) {
6031
- clear();
6032
- return true;
6033
- }
6034
- return false;
6035
6041
  };
6036
6042
  const isInElementAction = () => {
6037
6043
  const elementActionType = sharer.getSharedStorage(keyActionType);
@@ -6080,6 +6086,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6080
6086
  const resetControlType = (e) => {
6081
6087
  const data = sharer.getActiveStorage("data");
6082
6088
  const controller = sharer.getSharedStorage(keyLayoutController);
6089
+ let controllerType = null;
6083
6090
  if (controller && (data == null ? void 0 : data.layout) && (e == null ? void 0 : e.point)) {
6084
6091
  let layoutControlType = null;
6085
6092
  if (controller) {
@@ -6095,14 +6102,19 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6095
6102
  if (layoutControlType) {
6096
6103
  sharer.setSharedStorage(keyLayoutControlType, layoutControlType);
6097
6104
  eventHub.trigger(coreEventKeys.CLEAR_SELECT);
6098
- return layoutControlType;
6105
+ controllerType = layoutControlType;
6099
6106
  }
6100
6107
  }
6101
6108
  }
6102
- return null;
6109
+ if (controllerType) {
6110
+ sharer.setSharedStorage(keyLayoutIsHoverController, true);
6111
+ } else {
6112
+ sharer.setSharedStorage(keyLayoutIsHoverController, false);
6113
+ }
6114
+ return controllerType;
6103
6115
  };
6104
6116
  const updateCursor = (controlType) => {
6105
- if (isBusy === true) {
6117
+ if (sharer.getSharedStorage(keyLayoutIsBusyMoving) === true) {
6106
6118
  return;
6107
6119
  }
6108
6120
  eventHub.trigger(coreEventKeys.CURSOR, {
@@ -6118,22 +6130,19 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6118
6130
  resetController();
6119
6131
  },
6120
6132
  hover: (e) => {
6121
- if (isBusy === true) {
6133
+ if (sharer.getSharedStorage(keyLayoutIsBusyMoving) === true) {
6122
6134
  return;
6123
6135
  }
6124
6136
  if (isInElementAction()) {
6125
6137
  return;
6126
6138
  }
6127
- if (isInElementHover()) {
6128
- return;
6129
- }
6130
6139
  if (isInLayout(e.point)) {
6131
- sharer.setSharedStorage(keyLayoutIsHover, true);
6140
+ sharer.setSharedStorage(keyLayoutIsHoverContent, true);
6132
6141
  } else {
6133
- sharer.setSharedStorage(keyLayoutIsHover, false);
6134
- if (prevIsHover === true) {
6142
+ sharer.setSharedStorage(keyLayoutIsHoverContent, false);
6143
+ if (prevIsHoverContent === true) {
6135
6144
  viewer.drawFrame();
6136
- prevIsHover = false;
6145
+ prevIsHoverContent = false;
6137
6146
  }
6138
6147
  }
6139
6148
  if (sharer.getSharedStorage(keyLayoutIsSelected) === true) {
@@ -6154,12 +6163,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6154
6163
  updateCursor(layoutControlType);
6155
6164
  }
6156
6165
  }
6166
+ if (sharer.getSharedStorage(keyLayoutIsHoverController) === true) {
6167
+ return false;
6168
+ }
6157
6169
  return;
6158
6170
  }
6159
- if (sharer.getSharedStorage(keyLayoutIsHover) && !prevIsHover) {
6171
+ if (sharer.getSharedStorage(keyLayoutIsHoverContent) && !prevIsHoverContent) {
6160
6172
  viewer.drawFrame();
6161
6173
  }
6162
- prevIsHover = sharer.getSharedStorage(keyLayoutIsHover);
6174
+ prevIsHoverContent = sharer.getSharedStorage(keyLayoutIsHoverContent);
6175
+ if (sharer.getSharedStorage(keyLayoutIsHoverController) === true) {
6176
+ return false;
6177
+ }
6163
6178
  },
6164
6179
  pointStart: (e) => {
6165
6180
  if (isInElementAction()) {
@@ -6184,6 +6199,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6184
6199
  viewer.drawFrame();
6185
6200
  }
6186
6201
  prevIsSelected = sharer.getSharedStorage(keyLayoutIsSelected);
6202
+ if (sharer.getSharedStorage(keyLayoutIsHoverController) === true) {
6203
+ return false;
6204
+ }
6187
6205
  },
6188
6206
  pointMove: (e) => {
6189
6207
  if (!sharer.getSharedStorage(keyLayoutIsSelected)) {
@@ -6196,7 +6214,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6196
6214
  const data = sharer.getActiveStorage("data");
6197
6215
  if (layoutActionType === "resize" && layoutControlType && (data == null ? void 0 : data.layout)) {
6198
6216
  if (prevPoint) {
6199
- isBusy = true;
6217
+ sharer.setSharedStorage(keyLayoutIsBusyMoving, true);
6200
6218
  const scale = sharer.getActiveStorage("scale");
6201
6219
  const viewMoveX = e.point.x - prevPoint.x;
6202
6220
  const viewMoveY = e.point.y - prevPoint.y;
@@ -6274,7 +6292,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6274
6292
  }
6275
6293
  },
6276
6294
  pointEnd: () => {
6277
- isBusy = false;
6295
+ sharer.setSharedStorage(keyLayoutIsBusyMoving, false);
6278
6296
  const layoutActionType = sharer.getSharedStorage(keyLayoutActionType);
6279
6297
  const layoutControlType = sharer.getSharedStorage(keyLayoutControlType);
6280
6298
  const data = sharer.getActiveStorage("data");
@@ -6284,6 +6302,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6284
6302
  data
6285
6303
  });
6286
6304
  }
6305
+ if (sharer.getSharedStorage(keyLayoutIsHoverController) === true) {
6306
+ return false;
6307
+ }
6287
6308
  },
6288
6309
  beforeDrawFrame: ({ snapshot }) => {
6289
6310
  var _a;
@@ -6292,7 +6313,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6292
6313
  }
6293
6314
  const { sharedStore, activeStore } = snapshot;
6294
6315
  const layoutActionType = sharedStore[keyLayoutActionType];
6295
- const layoutIsHover = sharedStore[keyLayoutIsHover];
6316
+ const layoutIsHover = sharedStore[keyLayoutIsHoverContent];
6296
6317
  const layoutIsSelected = sharedStore[keyLayoutIsSelected];
6297
6318
  if ((_a = activeStore.data) == null ? void 0 : _a.layout) {
6298
6319
  const { x: x2, y: y2, w: w2, h: h2 } = activeStore.data.layout;
@@ -6660,6 +6681,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6660
6681
  eventHub.off(MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE, showInfoAngleCallback);
6661
6682
  },
6662
6683
  beforeDrawFrame({ snapshot }) {
6684
+ var _a;
6663
6685
  const { sharedStore } = snapshot;
6664
6686
  const selectedElementList = sharedStore[keySelectedElementList];
6665
6687
  const actionType = sharedStore[keyActionType];
@@ -6737,18 +6759,20 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6737
6759
  style
6738
6760
  });
6739
6761
  if (showAngleInfo) {
6740
- drawAngleInfoText(overlayContext, {
6741
- point: {
6742
- x: rectInfo.top.x + infoFontSize + 4,
6743
- y: rectInfo.top.y - infoFontSize * 2 - 18
6744
- },
6745
- rotateCenter: rectInfo.center,
6746
- angle: totalAngle,
6747
- text: angleText,
6748
- fontSize: infoFontSize,
6749
- lineHeight: infoLineHeight,
6750
- style
6751
- });
6762
+ if (((_a = elem.operations) == null ? void 0 : _a.rotatable) !== false) {
6763
+ drawAngleInfoText(overlayContext, {
6764
+ point: {
6765
+ x: rectInfo.top.x + infoFontSize + 4,
6766
+ y: rectInfo.top.y - infoFontSize * 2 - 18
6767
+ },
6768
+ rotateCenter: rectInfo.center,
6769
+ angle: totalAngle,
6770
+ text: angleText,
6771
+ fontSize: infoFontSize,
6772
+ lineHeight: infoLineHeight,
6773
+ style
6774
+ });
6775
+ }
6752
6776
  }
6753
6777
  }
6754
6778
  }
@@ -6919,6 +6943,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
6919
6943
  hover: (e) => {
6920
6944
  var _a, _b, _c, _d, _e;
6921
6945
  const layoutIsSelected = sharer.getSharedStorage(keyLayoutIsSelected);
6946
+ const layoutIsBusyMoving = sharer.getSharedStorage(keyLayoutIsBusyMoving);
6947
+ if (layoutIsBusyMoving === true) {
6948
+ return;
6949
+ }
6922
6950
  const resizeType = sharer.getSharedStorage(keyResizeType);
6923
6951
  const actionType = sharer.getSharedStorage(keyActionType);
6924
6952
  const groupQueue = sharer.getSharedStorage(keyGroupQueue);
@@ -7099,7 +7127,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
7099
7127
  inBusyMode = "drag";
7100
7128
  eventHub.trigger(MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE, { show: false });
7101
7129
  if (data && (elems == null ? void 0 : elems.length) === 1 && moveOriginalStartElementSize && originalStart && end && ((_b = (_a = elems[0]) == null ? void 0 : _a.operations) == null ? void 0 : _b.locked) !== true) {
7102
- const { moveX, moveY } = calcMoveInGroup(originalStart, end, groupQueue);
7130
+ const { moveX, moveY } = calcPointMoveElementInGroup(originalStart, end, groupQueue);
7103
7131
  let totalMoveX = calculator.toGridNum(moveX / scale);
7104
7132
  let totalMoveY = calculator.toGridNum(moveY / scale);
7105
7133
  if (enableSnapToGrid === true) {
@@ -7421,7 +7449,19 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
7421
7449
  const isMoving = sharedStore[keyIsMoving];
7422
7450
  const enableSnapToGrid = sharedStore[keyEnableSnapToGrid];
7423
7451
  const drawBaseOpts = { calculator, viewScaleInfo, viewSizeInfo, style };
7424
- const selectedElementController = sharedStore[keySelectedElementController];
7452
+ let selectedElementController = sharedStore[keySelectedElementController];
7453
+ if (selectedElementController && selectedElements.length === 1 && elem) {
7454
+ if (!isSameElementSize(elem, selectedElementController.originalElementSize)) {
7455
+ selectedElementController = calcElementSizeController(elem, {
7456
+ groupQueue: groupQueue || [],
7457
+ controllerSize: controllerSize$1,
7458
+ viewScaleInfo,
7459
+ rotateControllerPosition,
7460
+ rotateControllerSize
7461
+ });
7462
+ sharer2.setSharedStorage(keySelectedElementController, selectedElementController);
7463
+ }
7464
+ }
7425
7465
  const isHoverLocked = !!((_a = hoverElement == null ? void 0 : hoverElement.operations) == null ? void 0 : _a.locked);
7426
7466
  if ((groupQueue == null ? void 0 : groupQueue.length) > 0) {
7427
7467
  drawGroupQueueVertexesWrappers(overlayContext, groupQueueVertexesList, drawBaseOpts);
@@ -8538,6 +8578,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
8538
8578
  const { devicePixelRatio = 1, width, height, createCustomContext2D } = opts;
8539
8579
  __privateSet(this, _container2, container);
8540
8580
  const canvas = document.createElement("canvas");
8581
+ canvas.setAttribute("tabindex", "0");
8541
8582
  __privateSet(this, _canvas, canvas);
8542
8583
  __privateMethod(this, _Core_instances, initContainer_fn).call(this);
8543
8584
  container.appendChild(canvas);