Skip to content

Commit 5e1e495

Browse files
committed
Rotated texture frames added
1 parent 7414158 commit 5e1e495

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

v3/src/textures/Frame.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,17 @@ Frame.prototype = {
245245
var th = this.source.height;
246246
var uvs = this.data.uvs;
247247

248-
uvs.x0 = this.cutX / tw;
249-
uvs.y0 = this.cutY / th;
250-
251-
uvs.x1 = (this.cutX + this.cutHeight) / tw;
252-
uvs.y1 = this.cutY / th;
248+
uvs.x3 = (this.cutX + this.cutHeight) / tw;
249+
uvs.y3 = (this.cutY + this.cutWidth) / th;
253250

254-
uvs.x2 = (this.cutX + this.cutHeight) / tw;
251+
uvs.x2 = this.cutX / tw;
255252
uvs.y2 = (this.cutY + this.cutWidth) / th;
256-
257-
uvs.x3 = this.cutX / tw;
258-
uvs.y3 = (this.cutY + this.cutWidth) / th;
253+
254+
uvs.x1 = this.cutX / tw;
255+
uvs.y1 = this.cutY / th;
256+
257+
uvs.x0 = (this.cutX + this.cutHeight) / tw;
258+
uvs.y0 = this.cutY / th;
259259

260260
return this;
261261
},

v3/src/textures/parsers/JSONArrayTextureParser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var JSONArrayTextureParser = function (texture, sourceIndex, json)
5353
if (src.rotated)
5454
{
5555
newFrame.rotated = true;
56+
newFrame.updateUVsInverted();
5657
}
5758
}
5859

v3/src/textures/parsers/JSONHashTextureParser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var JSONHashTextureParser = function (texture, sourceIndex, json)
5353
if (src.rotated)
5454
{
5555
newFrame.rotated = true;
56+
newFrame.updateUVsInverted();
5657
}
5758
}
5859

0 commit comments

Comments
 (0)