@next2d/display 1.15.0 → 1.16.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/dist/Shape.js CHANGED
@@ -28,18 +28,6 @@ export class Shape extends DisplayObject {
28
28
  * @private
29
29
  */
30
30
  this._$graphics = null;
31
- /**
32
- * @type {object}
33
- * @default null
34
- * @private
35
- */
36
- this._$bounds = null;
37
- /**
38
- * @type {number}
39
- * @default 0
40
- * @private
41
- */
42
- this._$bitmapId = 0;
43
31
  /**
44
32
  * @type {string}
45
33
  * @default ""
@@ -122,6 +110,9 @@ export class Shape extends DisplayObject {
122
110
  return this._$src;
123
111
  }
124
112
  set src(src) {
113
+ if (!src) {
114
+ return;
115
+ }
125
116
  const image = new Image();
126
117
  image.addEventListener("load", () => {
127
118
  const width = image.width;
@@ -137,6 +128,7 @@ export class Shape extends DisplayObject {
137
128
  }
138
129
  });
139
130
  this._$src = image.src = src;
131
+ this.graphics._$mode = "bitmap";
140
132
  }
141
133
  /**
142
134
  * @param {object} character
@@ -154,7 +146,6 @@ export class Shape extends DisplayObject {
154
146
  switch (true) {
155
147
  case character.bitmapId > 0:
156
148
  {
157
- this._$bitmapId = character.bitmapId;
158
149
  const bitmap = loaderInfo
159
150
  ._$data
160
151
  .characters[character.bitmapId];
@@ -172,6 +163,11 @@ export class Shape extends DisplayObject {
172
163
  bitmapData.buffer = bitmap._$buffer.slice();
173
164
  // setup
174
165
  graphics._$recode = $getArray();
166
+ if (width === character.bounds.xMax - character.bounds.xMin
167
+ && height === character.bounds.yMax - character.bounds.yMin) {
168
+ graphics._$bitmapId = character.bitmapId;
169
+ graphics._$mode = "bitmap";
170
+ }
175
171
  // clone
176
172
  const recodes = character.recodes;
177
173
  if (recodes[recodes.length - 1] === Graphics.END_FILL) {
@@ -214,6 +210,11 @@ export class Shape extends DisplayObject {
214
210
  graphics._$recode[idx++] = bitmapData;
215
211
  const matrix = recodes[idx];
216
212
  graphics._$recode[idx] = $getFloat32Array6(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
213
+ if (value.width === character.bounds.xMax - character.bounds.xMin
214
+ && value.height === character.bounds.yMax - character.bounds.yMin) {
215
+ graphics._$bitmapId = character.bitmapId;
216
+ graphics._$mode = "bitmap";
217
+ }
217
218
  }
218
219
  }
219
220
  break;
@@ -223,6 +224,7 @@ export class Shape extends DisplayObject {
223
224
  }
224
225
  }
225
226
  else {
227
+ graphics._$mode = "bitmap";
226
228
  const width = $Math.abs(character.bounds.xMax - character.bounds.xMin);
227
229
  const height = $Math.abs(character.bounds.yMax - character.bounds.yMin);
228
230
  const bitmapData = new BitmapData(width, height);
package/dist/Stage.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { DisplayObjectContainer } from "./DisplayObjectContainer";
2
- import { $devicePixelRatio } from "@next2d/util";
3
- import { $clamp, $toColorInt, $uintToRGBA } from "@next2d/share";
2
+ import { $clamp, $toColorInt, $uintToRGBA, $devicePixelRatio } from "@next2d/share";
4
3
  /**
5
4
  * Stage クラスはメイン描画領域を表します。
6
5
  * The Stage class represents the main drawing area.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/display",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Next2D Display Packages",
5
5
  "author": "Toshiyuki Ienaga<ienaga@tvon.jp> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
@@ -32,14 +32,14 @@
32
32
  "url": "git+https://github.com/Next2D/Player.git"
33
33
  },
34
34
  "peerDependencies": {
35
- "@next2d/interface": "1.15.0",
36
- "@next2d/core": "1.15.0",
37
- "@next2d/geom": "1.15.0",
38
- "@next2d/util": "1.15.0",
39
- "@next2d/share": "1.15.0",
40
- "@next2d/webgl": "1.15.0",
41
- "@next2d/media": "1.15.0",
42
- "@next2d/net": "1.15.0",
43
- "@next2d/events": "1.15.0"
35
+ "@next2d/interface": "1.16.0",
36
+ "@next2d/core": "1.16.0",
37
+ "@next2d/geom": "1.16.0",
38
+ "@next2d/util": "1.16.0",
39
+ "@next2d/share": "1.16.0",
40
+ "@next2d/webgl": "1.16.0",
41
+ "@next2d/media": "1.16.0",
42
+ "@next2d/net": "1.16.0",
43
+ "@next2d/events": "1.16.0"
44
44
  }
45
45
  }