@next2d/display 3.9.1 → 3.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/display",
3
- "version": "3.9.1",
3
+ "version": "3.10.0",
4
4
  "description": "Next2D Display Package",
5
5
  "author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
@@ -23,15 +23,14 @@
23
23
  "type": "git",
24
24
  "url": "git+https://github.com/Next2D/Player.git"
25
25
  },
26
- "sideEffects": false,
27
26
  "dependencies": {
28
- "@next2d/ui": "3.9.1",
29
- "@next2d/text": "3.9.1",
30
- "@next2d/geom": "3.9.1",
31
- "@next2d/media": "3.9.1",
32
- "@next2d/net": "3.9.1",
33
- "@next2d/events": "3.9.1",
34
- "@next2d/filters": "3.9.1",
35
- "@next2d/render-queue": "3.9.1"
27
+ "@next2d/ui": "3.10.0",
28
+ "@next2d/text": "3.10.0",
29
+ "@next2d/geom": "3.10.0",
30
+ "@next2d/media": "3.10.0",
31
+ "@next2d/net": "3.10.0",
32
+ "@next2d/events": "3.10.0",
33
+ "@next2d/filters": "3.10.0",
34
+ "@next2d/render-queue": "3.10.0"
36
35
  }
37
36
  }
@@ -0,0 +1,11 @@
1
+ import type { Graphics } from "../../Graphics";
2
+ /**
3
+ * @description Graphicsを所有するDisplayObjectの描画キャッシュを無効化
4
+ * Invalidate the drawing cache of the DisplayObject that owns the Graphics
5
+ *
6
+ * @param {Graphics} graphics
7
+ * @return {void}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export declare const execute: (graphics: Graphics) => void;
@@ -0,0 +1,30 @@
1
+ import { $cacheStore } from "@next2d/cache";
2
+ import { $graphicMap } from "../../DisplayObjectUtil";
3
+ import { execute as displayObjectApplyChangesService } from "../../DisplayObject/service/DisplayObjectApplyChangesService";
4
+ /**
5
+ * @description Graphicsを所有するDisplayObjectの描画キャッシュを無効化
6
+ * Invalidate the drawing cache of the DisplayObject that owns the Graphics
7
+ *
8
+ * @param {Graphics} graphics
9
+ * @return {void}
10
+ * @method
11
+ * @protected
12
+ */
13
+ export const execute = (graphics) => {
14
+ const displayObject = $graphicMap.get(graphics);
15
+ if (!displayObject) {
16
+ return;
17
+ }
18
+ // cache clear
19
+ // Main 側のみ wipe する。Worker 側は次回 MISS 描画時に
20
+ // 旧 Node を解放してから新 Node を確保するため、ここで $removeIds.push しない。
21
+ if (displayObject.uniqueKey !== "" && $cacheStore.has(displayObject.uniqueKey)) {
22
+ $cacheStore.removeById(displayObject.uniqueKey);
23
+ }
24
+ // characterId 由来の uniqueKey は再生成後も同一値になるため、
25
+ // 旧テクスチャを参照したままの $cache も切り離す
26
+ displayObject.uniqueKey = "";
27
+ displayObject.$cache = null;
28
+ // apply changes
29
+ displayObjectApplyChangesService(displayObject);
30
+ };
package/src/Graphics.js CHANGED
@@ -6,6 +6,7 @@ import { execute as graphicsDrawEllipseService } from "./Graphics/service/Graphi
6
6
  import { execute as graphicsDrawRectService } from "./Graphics/service/GraphicsDrawRectService";
7
7
  import { execute as graphicsDrawRoundRectService } from "./Graphics/service/GraphicsDrawRoundRectService";
8
8
  import { execute as graphicsToNumberArrayService } from "./Graphics/service/GraphicsToNumberArrayService";
9
+ import { execute as graphicsInvalidateOwnerCacheUseCase } from "./Graphics/usecase/GraphicsInvalidateOwnerCacheUseCase";
9
10
  import { $getArray, $poolArray, $clamp, $convertColorStringToNumber } from "./DisplayObjectUtil";
10
11
  /**
11
12
  * @description Graphics クラスには、ベクターシェイプの作成に使用できる一連のメソッドがあります。
@@ -701,6 +702,9 @@ export class Graphics {
701
702
  this.$recodes = null;
702
703
  this._$fills = null;
703
704
  this._$lines = null;
705
+ this.isConfirmed = false;
706
+ // 所有DisplayObjectの描画キャッシュを破棄して再描画を画面に反映させる
707
+ graphicsInvalidateOwnerCacheUseCase(this);
704
708
  return this;
705
709
  }
706
710
  /**
@@ -1,5 +1,3 @@
1
- import { $cacheStore } from "@next2d/cache";
2
- import { execute as displayObjectApplyChangesService } from "../../DisplayObject/service/DisplayObjectApplyChangesService";
3
1
  /**
4
2
  * @description BitmapBufferの設定をクリア
5
3
  * Clear the BitmapBuffer settings
@@ -13,15 +11,7 @@ export const execute = (shape) => {
13
11
  shape.isBitmap = false;
14
12
  shape.$bitmapBuffer = null;
15
13
  // graphics clear
14
+ // キャッシュ破棄と changed の伝搬は clear() 内の
15
+ // GraphicsInvalidateOwnerCacheUseCase で行われる
16
16
  shape.graphics.clear();
17
- // cache clear
18
- // Main 側のみ wipe する。Worker 側は次回 MISS 描画時に
19
- // 旧 Node を解放してから新 Node を確保するため、ここで $removeIds.push しない。
20
- // push してしまうと、Worker が同フレームで作成した新キャッシュを次フレーム冒頭で
21
- // wipe → その次のフレームで Main HIT → Worker null → 永続無描画 になる。
22
- if (shape.uniqueKey !== "" && $cacheStore.has(shape.uniqueKey)) {
23
- $cacheStore.removeById(shape.uniqueKey);
24
- }
25
- // apply changes
26
- displayObjectApplyChangesService(shape);
27
17
  };