Skip to content

Commit

Permalink
Merge pull request #712 from jonobr1/711-zui
Browse files Browse the repository at this point in the history
Update extras to Matrix API changes
  • Loading branch information
jonobr1 authored Oct 16, 2023
2 parents cc6dee6 + a09feb5 commit 7f6d95d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions extras/js/zui.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
z = typeof c === 'number' ? c : 1;
}
const n = this.viewportOffset.matrix.inverse().multiply(x, y, z);
return m.multiply(n.x, n.y, n.z);
const r = m.multiply(n[0], n[1], n[2]);
return { x: r[0], y: r[1], z: r[2] };
}

surfaceToClient(a, b, c) {
Expand All @@ -161,7 +162,8 @@
z = typeof c === 'number' ? c : 1;
}
const sm = this.surfaceMatrix.multiply(x, y, z);
return vo.multiply(sm.x, sm.y, sm.z);
const r = vo.multiply(sm[0], sm[1], sm[2]);
return { x: r[0], y: r[1], z: r[2] };
}

zoomBy(byF, clientX, clientY) {
Expand Down
6 changes: 4 additions & 2 deletions extras/jsm/zui.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export class ZUI {
z = typeof c === 'number' ? c : 1;
}
const n = this.viewportOffset.matrix.inverse().multiply(x, y, z);
return m.multiply(n.x, n.y, n.z);
const r = m.multiply(n[0], n[1], n[2]);
return { x: r[0], y: r[1], z: r[2] };
}

/**
Expand Down Expand Up @@ -204,7 +205,8 @@ export class ZUI {
z = typeof c === 'number' ? c : 1;
}
const sm = this.surfaceMatrix.multiply(x, y, z);
return vo.multiply(sm.x, sm.y, sm.z);
const r = vo.multiply(sm[0], sm[1], sm[2]);
return { x: r[0], y: r[1], z: r[2] };
}

/**
Expand Down

0 comments on commit 7f6d95d

Please sign in to comment.