Skip to content

Commit a8574b4

Browse files
committed
Phaser 2.2 Release Candidate 8
1 parent 09e6839 commit a8574b4

14 files changed

Lines changed: 3613 additions & 2886 deletions

build/custom/phaser-arcade-physics.js

Lines changed: 790 additions & 560 deletions
Large diffs are not rendered by default.

build/custom/phaser-arcade-physics.min.js

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-ninja-physics.js

Lines changed: 790 additions & 560 deletions
Large diffs are not rendered by default.

build/custom/phaser-ninja-physics.min.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-no-libs.js

Lines changed: 740 additions & 531 deletions
Large diffs are not rendered by default.

build/custom/phaser-no-libs.min.js

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-no-physics.js

Lines changed: 367 additions & 560 deletions
Large diffs are not rendered by default.

build/custom/phaser-no-physics.min.js

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/pixi.js

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,6 @@ PIXI.DisplayObject.prototype.updateTransform = function()
12201220
// temporary matrix variables
12211221
var a, b, c, d, tx, ty;
12221222

1223-
// TODO create a const for 2_PI
12241223
// so if rotation is between 0 then we can simplify the multiplication process..
12251224
if(this.rotation % PIXI.PI_2)
12261225
{
@@ -2236,43 +2235,65 @@ PIXI.Sprite.prototype.getBounds = function(matrix)
22362235
var tx = worldTransform.tx;
22372236
var ty = worldTransform.ty;
22382237

2239-
var x1 = a * w1 + c * h1 + tx;
2240-
var y1 = d * h1 + b * w1 + ty;
2241-
2242-
var x2 = a * w0 + c * h1 + tx;
2243-
var y2 = d * h1 + b * w0 + ty;
2244-
2245-
var x3 = a * w0 + c * h0 + tx;
2246-
var y3 = d * h0 + b * w0 + ty;
2247-
2248-
var x4 = a * w1 + c * h0 + tx;
2249-
var y4 = d * h0 + b * w1 + ty;
2250-
22512238
var maxX = -Infinity;
22522239
var maxY = -Infinity;
22532240

22542241
var minX = Infinity;
22552242
var minY = Infinity;
22562243

2257-
minX = x1 < minX ? x1 : minX;
2258-
minX = x2 < minX ? x2 : minX;
2259-
minX = x3 < minX ? x3 : minX;
2260-
minX = x4 < minX ? x4 : minX;
2244+
if(b === 0 && c === 0)
2245+
{
2246+
// scale may be negative!
2247+
if(a < 0)a *= -1;
2248+
if(d < 0)d *= -1;
22612249

2262-
minY = y1 < minY ? y1 : minY;
2263-
minY = y2 < minY ? y2 : minY;
2264-
minY = y3 < minY ? y3 : minY;
2265-
minY = y4 < minY ? y4 : minY;
2250+
// this means there is no rotation going on right? RIGHT?
2251+
// if thats the case then we can avoid checking the bound values! yay
2252+
minX = a * w1 + tx;
2253+
maxX = a * w0 + tx;
2254+
minY = d * h1 + ty;
2255+
maxY = d * h0 + ty;
2256+
}
2257+
else
2258+
{
2259+
var x1 = a * w1 + c * h1 + tx;
2260+
var y1 = d * h1 + b * w1 + ty;
22662261

2267-
maxX = x1 > maxX ? x1 : maxX;
2268-
maxX = x2 > maxX ? x2 : maxX;
2269-
maxX = x3 > maxX ? x3 : maxX;
2270-
maxX = x4 > maxX ? x4 : maxX;
2262+
var x2 = a * w0 + c * h1 + tx;
2263+
var y2 = d * h1 + b * w0 + ty;
22712264

2272-
maxY = y1 > maxY ? y1 : maxY;
2273-
maxY = y2 > maxY ? y2 : maxY;
2274-
maxY = y3 > maxY ? y3 : maxY;
2275-
maxY = y4 > maxY ? y4 : maxY;
2265+
var x3 = a * w0 + c * h0 + tx;
2266+
var y3 = d * h0 + b * w0 + ty;
2267+
2268+
var x4 = a * w1 + c * h0 + tx;
2269+
var y4 = d * h0 + b * w1 + ty;
2270+
2271+
maxX = -Infinity;
2272+
maxY = -Infinity;
2273+
2274+
minX = Infinity;
2275+
minY = Infinity;
2276+
2277+
minX = x1 < minX ? x1 : minX;
2278+
minX = x2 < minX ? x2 : minX;
2279+
minX = x3 < minX ? x3 : minX;
2280+
minX = x4 < minX ? x4 : minX;
2281+
2282+
minY = y1 < minY ? y1 : minY;
2283+
minY = y2 < minY ? y2 : minY;
2284+
minY = y3 < minY ? y3 : minY;
2285+
minY = y4 < minY ? y4 : minY;
2286+
2287+
maxX = x1 > maxX ? x1 : maxX;
2288+
maxX = x2 > maxX ? x2 : maxX;
2289+
maxX = x3 > maxX ? x3 : maxX;
2290+
maxX = x4 > maxX ? x4 : maxX;
2291+
2292+
maxY = y1 > maxY ? y1 : maxY;
2293+
maxY = y2 > maxY ? y2 : maxY;
2294+
maxY = y3 > maxY ? y3 : maxY;
2295+
maxY = y4 > maxY ? y4 : maxY;
2296+
}
22762297

22772298
var bounds = this._bounds;
22782299

build/custom/pixi.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)