From f3f62b4eb7abdfe07101510da545fcbaa487f3d5 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Wed, 5 Oct 2022 21:00:23 -0400 Subject: [PATCH] sticky btn --- app/dofs/trackballer/Trackballer.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/dofs/trackballer/Trackballer.cs b/app/dofs/trackballer/Trackballer.cs index 0c1b2da..16ee8e3 100644 --- a/app/dofs/trackballer/Trackballer.cs +++ b/app/dofs/trackballer/Trackballer.cs @@ -26,10 +26,14 @@ class Trackballer : dof { Vec3 localPad = mAnchorInv.Transform(pad); Color color = Color.White; - btnIn.Step(localPad.Length < layer[0]); - if (localPad.Length < layer[0]) { - color = new Color(1, 0, 0); + if (btnIn.held) { + btnIn.Step(localPad.Length < layer[1]); + } else { + btnIn.Step(localPad.Length < layer[0]); } + color = btnIn.held ? new Color(1, 0, 0) : Color.White; + + btnOut.Step(localPad.Length > layer[2]); if (localPad.Length > layer[2]) { color = new Color(0, 1, 1);