From bbf5e3b0232c7bb2c54b046ee34ed2fd964b8cdf Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Fri, 17 Nov 2017 12:45:36 -0700 Subject: [PATCH] simplifications and comments --- scripts/system/notifications.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/system/notifications.js b/scripts/system/notifications.js index 6f211b768c..cb7251c8b0 100644 --- a/scripts/system/notifications.js +++ b/scripts/system/notifications.js @@ -212,9 +212,10 @@ buttonPosition; var sensorScaleFactor = isOnHMD ? MyAvatar.sensorToWorldScale : 1.0; // Notification plane positions - noticeY = -(y * sensorScaleFactor) * (NOTIFICATION_3D_SCALE * sensorScaleFactor) - (noticeHeight * sensorScaleFactor) / 2; + // y, NOTIFICATION_3D_SCALE and noticeHeight need to be scaled by sensorScaleFactor; + noticeY = -sensorScaleFactor * (y * NOTIFICATION_3D_SCALE * sensorScaleFactor + 0.5 * noticeHeight); notificationPosition = { x: 0, y: noticeY, z: 0 }; - buttonPosition = { x: (noticeWidth * sensorScaleFactor - NOTIFICATION_3D_BUTTON_WIDTH * sensorScaleFactor) / 2, y: noticeY, z: 0.001 }; + buttonPosition = { x: 0.5 * sensorScaleFactor * (noticeWidth - NOTIFICATION_3D_BUTTON_WIDTH), y: noticeY, z: 0.001 }; // Rotate plane notificationOrientation = Quat.fromPitchYawRollDegrees(NOTIFICATIONS_3D_PITCH,