mirror of
https://github.com/wassname/phaser-plugin-isometric.git
synced 2026-08-29 11:23:44 +08:00
Fixed inaccurate unprojection if world boundaries do not start at 0, 0 (spotted by oboforty on the forums).
This commit is contained in:
Vendored
+2
-2
@@ -1842,8 +1842,8 @@ Phaser.Plugin.Isometric.Projector.prototype = {
|
||||
z = z || 0;
|
||||
|
||||
|
||||
var x = point.x - (this.game.world.width * this.anchor.x);
|
||||
var y = point.y - (this.game.world.height * this.anchor.y) + z;
|
||||
var x = point.x - this.game.world.x - (this.game.world.width * this.anchor.x);
|
||||
var y = point.y - this.game.world.y - (this.game.world.height * this.anchor.y) + z;
|
||||
|
||||
out.x = x / (2 * this._transform[0]) + y / (2 * this._transform[1]);
|
||||
out.y = -(x / (2 * this._transform[0])) + y / (2 * this._transform[1]);
|
||||
|
||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "phaser-plugin-isometric",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.2",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-contrib-clean": "^0.5.0",
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ Phaser.Plugin.Isometric = function (game, parent) {
|
||||
Phaser.Plugin.Isometric.prototype = Object.create(Phaser.Plugin.prototype);
|
||||
Phaser.Plugin.Isometric.prototype.constructor = Phaser.Plugin.Isometric;
|
||||
|
||||
Phaser.Plugin.Isometric.VERSION = '0.9.1';
|
||||
Phaser.Plugin.Isometric.VERSION = '0.9.2';
|
||||
|
||||
// Directional consts
|
||||
Phaser.Plugin.Isometric.UP = 0;
|
||||
|
||||
+2
-2
@@ -108,8 +108,8 @@ Phaser.Plugin.Isometric.Projector.prototype = {
|
||||
z = z || 0;
|
||||
|
||||
|
||||
var x = point.x - (this.game.world.width * this.anchor.x);
|
||||
var y = point.y - (this.game.world.height * this.anchor.y) + z;
|
||||
var x = point.x - this.game.world.x - (this.game.world.width * this.anchor.x);
|
||||
var y = point.y - this.game.world.y - (this.game.world.height * this.anchor.y) + z;
|
||||
|
||||
out.x = x / (2 * this._transform[0]) + y / (2 * this._transform[1]);
|
||||
out.y = -(x / (2 * this._transform[0])) + y / (2 * this._transform[1]);
|
||||
|
||||
Reference in New Issue
Block a user