mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
First implementation of tool tester
This commit is contained in:
@@ -196,6 +196,28 @@
|
||||
};
|
||||
};
|
||||
|
||||
ns.FrameRenderer.prototype.reverseCoordinates = function(x, y) {
|
||||
var cellSize = this.zoom;
|
||||
|
||||
x = x * cellSize;
|
||||
y = y * cellSize;
|
||||
|
||||
x = x - this.offset.x * cellSize;
|
||||
y = y - this.offset.y * cellSize;
|
||||
|
||||
x = x + this.margin.x;
|
||||
y = y + this.margin.y;
|
||||
|
||||
var containerOffset = this.container.offset();
|
||||
x = x + containerOffset.left;
|
||||
y = y + containerOffset.top;
|
||||
|
||||
return {
|
||||
x : x + (cellSize/2),
|
||||
y : y + (cellSize/2)
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user