@vvfx/sdk 0.2.2-beta.5 → 0.2.2-beta.6

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.
@@ -8,7 +8,7 @@ export type CardOverlayBoxStyle = {
8
8
  contentHeight: number;
9
9
  transform: string;
10
10
  };
11
- export declare function getCardOverlayBoxStyle(box: Box2, width: number, height: number, offsetX?: number, offsetY?: number, autoScale?: boolean): CardOverlayBoxStyle;
11
+ export declare function getCardOverlayBoxStyle(box: Box2, width: number, height: number, offsetX?: number, offsetY?: number, _autoScale?: boolean): CardOverlayBoxStyle;
12
12
  export declare function isPointInCardOverlayBox(box: Box2, point: {
13
13
  x: number;
14
14
  y: number;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: TODO
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 赤芍,何即,不择,意绮
6
- * Version: v0.2.2-beta.5
6
+ * Version: v0.2.2-beta.6
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -55558,6 +55558,16 @@ var TransformGizmo = /*#__PURE__*/ function(Gizmo) {
55558
55558
  newWidth,
55559
55559
  newHeight
55560
55560
  ], translation1);
55561
+ } else if (selectedItem && selectedItems.length === 1 && isCardItem(selectedItem)) {
55562
+ void this._pageDataUtils.setItemProperty({
55563
+ itemId: selectedItem.id,
55564
+ type: SDKItemType.CARD,
55565
+ property: {
55566
+ width: selectedItem.width * resultScalar1.x,
55567
+ height: selectedItem.height * resultScalar1.y
55568
+ }
55569
+ });
55570
+ this._pageDataUtils.moveItem(selectedItem.id, translation1);
55561
55571
  } else {
55562
55572
  // 普通元素的缩放逻辑
55563
55573
  selectedItems.forEach(function(item) {
@@ -91824,14 +91834,13 @@ function syncElementStackOrder(_container, elements) {
91824
91834
  });
91825
91835
  }
91826
91836
 
91827
- function getCardOverlayBoxStyle(box, width, height, offsetX, offsetY, autoScale) {
91837
+ function getCardOverlayBoxStyle(box, width, height, offsetX, offsetY, _autoScale) {
91828
91838
  if (offsetX === void 0) offsetX = 0;
91829
91839
  if (offsetY === void 0) offsetY = 0;
91830
- if (autoScale === void 0) autoScale = true;
91831
91840
  if (box.corners.length === 4 && width > 0 && height > 0) {
91832
91841
  var _box_corners = box.corners, rightTop = _box_corners[0], leftBottom = _box_corners[2], leftTop = _box_corners[3];
91833
- var contentWidth = autoScale ? width : rightTop.distanceTo(leftTop);
91834
- var contentHeight = autoScale ? height : leftBottom.distanceTo(leftTop);
91842
+ var contentWidth = width;
91843
+ var contentHeight = height;
91835
91844
  var a = (rightTop.x - leftTop.x) / contentWidth;
91836
91845
  var b = (rightTop.y - leftTop.y) / contentWidth;
91837
91846
  var c = (leftBottom.x - leftTop.x) / contentHeight;
@@ -95205,8 +95214,7 @@ var SDK = /*#__PURE__*/ function() {
95205
95214
  * @param ignoreClamp 是否忽视约束
95206
95215
  */ _proto.setPageZoom = function setPageZoom(zoom, center, ignoreClamp) {
95207
95216
  assertExist$1(this._pageData);
95208
- this._pageData.property.zoom = zoom;
95209
- this._pageDataUtils.setPageZoom(this._pageData.property.zoom, center, ignoreClamp);
95217
+ this._pageDataUtils.setPageZoom(zoom, center, ignoreClamp);
95210
95218
  this._gestureHandler.render();
95211
95219
  };
95212
95220
  /**