From eab35d03d4ac70c413dad4fdd9b5a71e1e4b0176 Mon Sep 17 00:00:00 2001 From: Zander Otavka Date: Wed, 5 Aug 2015 10:24:03 -0700 Subject: [PATCH] Improve vector operations in floatingUIExample.js. --- examples/example/ui/floatingUIExample.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/examples/example/ui/floatingUIExample.js b/examples/example/ui/floatingUIExample.js index 6a8278ac8a..59d3b67d38 100644 --- a/examples/example/ui/floatingUIExample.js +++ b/examples/example/ui/floatingUIExample.js @@ -174,13 +174,7 @@ function onMouseUp(event) { if (overlay.attachedPanel === bluePanel) { overlay.destroy(); } else { - var oldPos = overlay.offsetPosition; - var newPos = { - x: Number(oldPos.x), - y: Number(oldPos.y), - z: Number(oldPos.z) - 0.1 - }; - overlay.offsetPosition = newPos; + overlay.offsetPosition = Vec3.sum(overlay.offsetPosition, { x: 0, y: 0, z: -0.1 }); } } }