@univerjs/sheets-drawing-ui 0.2.8 → 0.2.9

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/lib/es/index.js CHANGED
@@ -6,7 +6,7 @@ import { CommandType, ICommandService, IUndoRedoService, LocaleService, IUniverI
6
6
  import { ImageCropperObject, COMPONENT_IMAGE_POPUP_MENU, OpenImageCropOperation, ImageResetSizeOperation, DrawingCommonPanel, DrawingRenderService, UniverDrawingUIPlugin } from "@univerjs/drawing-ui";
7
7
  import { ISheetDrawingService, SetDrawingApplyMutation, DrawingApplyType, SheetDrawingAnchorType, UniverSheetsDrawingPlugin } from "@univerjs/sheets-drawing";
8
8
  import { IDrawingManagerService, IImageIoService, ArrangeTypeEnum, DrawingTypeEnum, DRAWING_IMAGE_COUNT_LIMIT, ImageUploadStatusType, DRAWING_IMAGE_ALLOW_SIZE, getImageSize, DRAWING_IMAGE_WIDTH_LIMIT, DRAWING_IMAGE_HEIGHT_LIMIT, DRAWING_IMAGE_ALLOW_IMAGE_LIST, getDrawingShapeKeyByDrawingSearch, UniverDrawingPlugin } from "@univerjs/drawing";
9
- import { IRenderManagerService, getGroupState, transformObjectOutOfGroup, precisionTo, Rect, DRAWING_OBJECT_LAYER_INDEX, pxToNum, SHEET_VIEWPORT_KEY, RENDER_CLASS_TYPE } from "@univerjs/engine-render";
9
+ import { IRenderManagerService, getGroupState, transformObjectOutOfGroup, precisionTo, Rect, DRAWING_OBJECT_LAYER_INDEX, SHEET_VIEWPORT_KEY, RENDER_CLASS_TYPE } from "@univerjs/engine-render";
10
10
  import { SheetCanvasPopManagerService, attachRangeWithCoord, SheetSkeletonManagerService, ISheetSelectionRenderService, getCurrentRangeDisable$, SetScrollOperation, SetZoomRatioOperation, SheetPrintInterceptorService, COPY_TYPE, PREDEFINED_HOOK_NAME, virtualizeDiscreteRanges, ISheetClipboardService } from "@univerjs/sheets-ui";
11
11
  import { takeUntil, Subject, BehaviorSubject, combineLatest, map, filter, distinctUntilChanged, first } from "rxjs";
12
12
  import { ISidebarService, BuiltInUIPart, IUIPartsService, IMessageService, MenuItemType, MenuPosition, MenuGroup, getMenuHiddenObservable, KeyCode, ComponentManager, IMenuService, IShortcutService, CanvasFloatDomService } from "@univerjs/ui";
@@ -1788,20 +1788,20 @@ function transformBound2DOMBound(originBound, scene, skeleton, worksheet) {
1788
1788
  }
1789
1789
  __name(transformBound2DOMBound, "transformBound2DOMBound");
1790
1790
  const calcPosition = /* @__PURE__ */ __name((targetObject, currentRender, skeleton, worksheet) => {
1791
- const { scene, engine } = currentRender, { left, top, width, height, angle } = targetObject, canvasElement = engine.getCanvasElement(), canvasClientRect = canvasElement.getBoundingClientRect(), widthOfCanvas = pxToNum(canvasElement.style.width), { top: topOffset, left: leftOffset, width: domWidth } = canvasClientRect, scaleAdjust = domWidth / widthOfCanvas, bound = {
1791
+ const { scene } = currentRender, { left, top, width, height, angle } = targetObject, bound = {
1792
1792
  left,
1793
1793
  right: left + width,
1794
1794
  top,
1795
1795
  bottom: top + height
1796
1796
  }, offsetBound = transformBound2DOMBound(bound, scene, skeleton, worksheet);
1797
1797
  return {
1798
- startX: offsetBound.left * scaleAdjust + leftOffset,
1799
- endX: offsetBound.right * scaleAdjust + leftOffset,
1800
- startY: offsetBound.top * scaleAdjust + topOffset,
1801
- endY: offsetBound.bottom * scaleAdjust + topOffset,
1798
+ startX: offsetBound.left,
1799
+ endX: offsetBound.right,
1800
+ startY: offsetBound.top,
1801
+ endY: offsetBound.bottom,
1802
1802
  rotate: angle,
1803
- width: width * scaleAdjust,
1804
- height: height * scaleAdjust,
1803
+ width,
1804
+ height,
1805
1805
  absolute: offsetBound.absolute
1806
1806
  };
1807
1807
  }, "calcPosition");
@@ -1895,7 +1895,8 @@ let SheetCanvasFloatDomManagerService = (_a5 = class extends Disposable {
1895
1895
  canvas.dispatchEvent(new WheelEvent(evt.type, evt));
1896
1896
  }, "onWheel"),
1897
1897
  props: (_c = (_b = map2.get(drawingId)) == null ? void 0 : _b.props) != null ? _c : this._getFloatDomProps(drawingId),
1898
- data
1898
+ data,
1899
+ unitId
1899
1900
  });
1900
1901
  const listener = rect.onTransformChange$.subscribeEvent(() => {
1901
1902
  const newPosition = calcPosition(rect, renderObject.renderObject, skeleton.skeleton, target.worksheet);