@fulate/tools 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @fulate/tools Editor integration
2
2
 
3
- 每个活动 Root 只有一个 `EditorInteractionController`。它拥有 selection、输入仲裁、Transform/Point
3
+ 每个活动 Root 只有一个 `EditorInteractionController`。它拥有 selection、输入仲裁、Transform/Point
4
4
  gesture、Content session、Line/LineTree branch draft 与 semantic History 边界;`Select` 只保留 command/paint
5
5
  surface,`LineTool` 只保留 command/preview surface。Transform 的每个已派发 pointer 输入都立即从
6
6
  frozen baseline 解析并提交一个 trusted batch;Point gesture 继续只在每个显示帧消费最后一个 intent。
package/dist/index.js CHANGED
@@ -567,6 +567,12 @@ function sameTarget(left, right) {
567
567
  function samePointScope(left, right) {
568
568
  return left.kind === right.kind && (left.kind === "owner" || right.kind === "subpath" && left.subpathId === right.subpathId);
569
569
  }
570
+ function resolveOriginPoint(bounds, x, y) {
571
+ return {
572
+ x: bounds.left + (resolveOrigin(x) + .5) * bounds.width,
573
+ y: bounds.top + (resolveOrigin(y) + .5) * bounds.height
574
+ };
575
+ }
570
576
  var TransformGesture = class {
571
577
  lastIntent;
572
578
  previousRotationAngle;
@@ -1127,10 +1133,7 @@ var EditorInteractionController = class {
1127
1133
  return {
1128
1134
  kind: "custom-owner-local",
1129
1135
  ownerKey: owner.key,
1130
- local: preview ?? {
1131
- x: bounds.left + (resolveOrigin(owner.rotationPivotX) + .5) * bounds.width,
1132
- y: bounds.top + (resolveOrigin(owner.rotationPivotY) + .5) * bounds.height
1133
- }
1136
+ local: preview ?? resolveOriginPoint(bounds, owner.rotationPivotX, owner.rotationPivotY)
1134
1137
  };
1135
1138
  }
1136
1139
  return { kind: "selection-center" };
@@ -2132,10 +2135,7 @@ var EditorInteractionController = class {
2132
2135
  const x = marker.horizontal;
2133
2136
  const y = marker.vertical;
2134
2137
  return {
2135
- local: {
2136
- x: bounds.left + (resolveOrigin(x) + .5) * bounds.width,
2137
- y: bounds.top + (resolveOrigin(y) + .5) * bounds.height
2138
- },
2138
+ local: resolveOriginPoint(bounds, x, y),
2139
2139
  x,
2140
2140
  y,
2141
2141
  markers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fulate/tools",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",