From 987876a61f4508f2c416b56cd8d38d3a2acb40e6 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 26 Nov 2021 21:32:19 -0500 Subject: [PATCH] change default home view for belt --- src/kiri/init.js | 3 ++- src/moto/space.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/kiri/init.js b/src/kiri/init.js index 445868c2..73b4c9f4 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -872,7 +872,8 @@ API.conf.save(); - API.const.SPACE.view.setHome(dev.bedBelt ? Math.PI/2 : 0); + // API.const.SPACE.view.setHome(dev.bedBelt ? Math.PI/2 : 0, Math.PI / 2.5); + API.const.SPACE.view.setHome(0, Math.PI / 2.5); // when changing devices, update focus on widgets if (chgdev) { setTimeout(API.space.set_focus, 0); diff --git a/src/moto/space.js b/src/moto/space.js index a37ea853..2465a142 100644 --- a/src/moto/space.js +++ b/src/moto/space.js @@ -20,6 +20,7 @@ panY = 0, panZ = 0, home = 0, + up = PI4, gridZOff = 0, tweenTime = 500, tweenDelay = 20, @@ -960,7 +961,7 @@ view: { top: function(then) { tweenCam({left: home, up: 0, panX, panY, panZ, then}) }, back: function(then) { tweenCam({left: PI, up: PI2, panX, panY, panZ, then}) }, - home: function(then) { tweenCam({left: home, up: PI4, panX, panY, panZ, then}) }, + home: function(then) { tweenCam({left: home, up, panX, panY, panZ, then}) }, front: function(then) { tweenCam({left: 0, up: PI2, panX, panY, panZ, then}) }, right: function(then) { tweenCam({left: PI2, up: PI2, panX, panY, panZ, then}) }, left: function(then) { tweenCam({left: -PI2, up: PI2, panX, panY, panZ, then}) }, @@ -982,8 +983,9 @@ viewControl.setTarget(v); refresh(); }, - setHome: function(r) { + setHome: function(r,u) { home = r || 0; + up = u || PI4; }, spin: function(then, count) { Space.view.front(() => {