@fulate/core 1.0.7 → 1.0.8

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/dist/index.js CHANGED
@@ -2266,7 +2266,7 @@ var ElementTransform = class {
2266
2266
  }
2267
2267
  /** 在清理 visual 缓存前保存最后一次提交的 world 绘制范围。 */
2268
2268
  captureCurrentVisualBounds() {
2269
- if (this.hasGeometry()) this.captureVisualBounds(this.getWorldVisualBoundsView());
2269
+ if (this.worldVisualBounds && this.hasGeometry()) this.captureVisualBounds(this.worldVisualBounds);
2270
2270
  }
2271
2271
  /** 将旧 visual bounds交给当前 transform 和所属 Layer 的 damage 跟踪。 */
2272
2272
  captureVisualBounds(bounds) {
@@ -2294,6 +2294,7 @@ var ElementTransform = class {
2294
2294
  invalidate(impact, previousBounds) {
2295
2295
  if (impact & CHILD_LAYOUT_IMPACT) this.childLayoutDirty = true;
2296
2296
  const visualGeometryChanged = (impact & VISUAL_GEOMETRY_IMPACT$1) !== 0;
2297
+ const invalidateAncestors = !this.needsCommit;
2297
2298
  if (!this.needsCommit) {
2298
2299
  if (visualGeometryChanged) {
2299
2300
  if (isUndefined(previousBounds)) this.captureCurrentVisualBounds();
@@ -2302,14 +2303,20 @@ var ElementTransform = class {
2302
2303
  this.hitOnlyInvalidation = !visualGeometryChanged && (impact & ChangeImpact.HitBounds) !== 0;
2303
2304
  this.needsCommit = true;
2304
2305
  this.currentRenderCoverageBounds = void 0;
2305
- this.markDirtyAncestors();
2306
2306
  } else if (this.hitOnlyInvalidation && visualGeometryChanged) {
2307
2307
  this.captureCurrentVisualBounds();
2308
2308
  this.hitOnlyInvalidation = false;
2309
2309
  }
2310
2310
  this.invalidateCache(impact);
2311
+ if (invalidateAncestors) this.markDirtyAncestors();
2311
2312
  if (this.element.isActive && !this.resolvingFitSize) this.element.layer.invalidateLayout(this.element);
2312
2313
  }
2314
+ /** A derived layout can change visual bounds during an already pending commit. @internal */
2315
+ invalidateLayoutBounds() {
2316
+ const pending = this.needsCommit;
2317
+ this.invalidate(ChangeImpact.VisualBounds);
2318
+ if (pending) this.markDirtyAncestors();
2319
+ }
2313
2320
  /** 标记 local 几何需要重新构建。 */
2314
2321
  markGeometryNeedsLayout(notifyScene = true) {
2315
2322
  const publish = !this.needsCommit;
@@ -192,6 +192,8 @@ export declare class ElementTransform<E extends Element = Element> {
192
192
  clearPreviousVisualBounds(): void;
193
193
  /** @internal 按影响范围失效几何并安排 Layer 提交。 */
194
194
  invalidate(impact: ChangeImpact, previousBounds?: Readonly<BoundingBox> | null): void;
195
+ /** A derived layout can change visual bounds during an already pending commit. @internal */
196
+ invalidateLayoutBounds(): void;
195
197
  /** 标记 local 几何需要重新构建。 */
196
198
  markGeometryNeedsLayout(notifyScene?: boolean): void;
197
199
  /** 安排当前元素所属 Layer 重绘。 @internal */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fulate/core",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",