From a09feb5975482bd7e201bc5c805990d27a06023b Mon Sep 17 00:00:00 2001 From: Jono Brandel Date: Mon, 16 Oct 2023 10:42:07 -0700 Subject: [PATCH] Update extras to Matrix API changes --- extras/js/zui.js | 6 ++++-- extras/jsm/zui.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/extras/js/zui.js b/extras/js/zui.js index 8ced7ec9..93560641 100644 --- a/extras/js/zui.js +++ b/extras/js/zui.js @@ -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) { @@ -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) { diff --git a/extras/jsm/zui.js b/extras/jsm/zui.js index 5e5aea83..f63a5ae3 100644 --- a/extras/jsm/zui.js +++ b/extras/jsm/zui.js @@ -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] }; } /** @@ -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] }; } /**