Skip to content

Commit 9ae833a

Browse files
committed
Fixed inverted y coords in positions output files.
1 parent 0ca81dd commit 9ae833a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fileWrite.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ function makePositionsString(nodeList){
225225
else{
226226
posJSON = posJSON + '"' + nodeList[i].data('id') + '": ';
227227
}
228-
//Scale the coordinates
228+
//Scale the coordinates (The y axis should be 0 - 1 from the bottom hence the 1 -)
229229
var relX = nodeList[i].position().x / 1080,
230-
relY = nodeList[i].position().y / 720;
230+
relY = 1 - nodeList[i].position().y / 720;
231231

232232
//Make sure the last entry doesn't have a comma
233233
if(i < nodeList.length - 1){

0 commit comments

Comments
 (0)