@leafer-ui/core 1.4.0 → 1.4.2

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/core.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Leafer, State, UI, ImageManager, Rect, Box, Group, Platform as Platform$1, Creator as Creator$1, emptyData } from '@leafer-ui/draw';
2
2
  export * from '@leafer-ui/draw';
3
- import { registerUI, Creator, PropertyEvent, Debug, DataHelper, canvasSizeAttrs, LayoutEvent, RenderEvent, Event, EventCreator, registerUIEvent, LeafList, PointHelper, BoundsHelper, Bounds, ResizeEvent, LeaferEvent, CanvasManager, Leaf, Matrix, Platform, tempBounds, LeaferCanvasBase } from '@leafer/core';
3
+ import { registerUI, Creator, PropertyEvent, Debug, DataHelper, canvasSizeAttrs, LayoutEvent, RenderEvent, Event, EventCreator, registerUIEvent, LeafList, PointHelper, BoundsHelper, Platform, Bounds, ResizeEvent, LeaferEvent, CanvasManager, Leaf, Matrix, tempBounds, LeaferCanvasBase } from '@leafer/core';
4
4
 
5
5
  /******************************************************************************
6
6
  Copyright (c) Microsoft Corporation.
@@ -254,7 +254,7 @@ let DragEvent = class DragEvent extends PointerEvent {
254
254
  const { draggable, dragBounds } = leaf, move = leaf.getLocalPoint(total, null, true);
255
255
  PointHelper.move(move, start.x - leaf.x, start.y - leaf.y);
256
256
  if (dragBounds)
257
- this.getMoveInDragBounds(leaf.__local, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
257
+ this.getMoveInDragBounds(leaf.__localBoxBounds, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
258
258
  if (draggable === 'x')
259
259
  move.y = 0;
260
260
  if (draggable === 'y')
@@ -957,7 +957,9 @@ class InteractionBase {
957
957
  }
958
958
  findPath(data, options) {
959
959
  const { hitRadius, through } = this.p;
960
- const { bottomList } = this;
960
+ const { bottomList, target } = this;
961
+ if (!Platform.backgrounder && !data.origin)
962
+ target && target.updateLayout();
961
963
  const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
962
964
  if (find.throughPath)
963
965
  data.throughPath = find.throughPath;
@@ -1202,9 +1204,9 @@ leaf.__hitWorld = function (point) {
1202
1204
  }
1203
1205
  return this.__hit(inner);
1204
1206
  };
1205
- leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
1206
- leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
1207
- leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
1207
+ leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
1208
+ leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
1209
+ leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
1208
1210
  leaf.__drawHitPath = function (canvas) { if (canvas)
1209
1211
  this.__drawRenderPath(canvas); };
1210
1212
 
@@ -1292,8 +1294,8 @@ function getSelector(ui) {
1292
1294
  return ui.leafer ? ui.leafer.selector : (Platform$1.selector || (Platform$1.selector = Creator$1.selector()));
1293
1295
  }
1294
1296
  Group.prototype.pick = function (hitPoint, options) {
1295
- this.leafer || this.updateLayout();
1296
1297
  options || (options = emptyData);
1298
+ this.updateLayout();
1297
1299
  return getSelector(this).getByPoint(hitPoint, options.hitRadius || 0, Object.assign(Object.assign({}, options), { target: this }));
1298
1300
  };
1299
1301