mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
fix(input): reach full guest screen with glasses pointer (#2145)
fix: the glasses pointer reaches the whole guest screen Absolute input was clamped to the letterboxed picture rect computed for the phone view, while the compositor reads the input space against the glasses output. With different shapes that limited the guest pointer to a middle band of the scene, so the bottom and top edges were unreachable. Send absolute pointer positions as the full-view fraction (the compositor already clamps to the scene) and use the whole view for the touchpad bounds and relative scale while the glasses own the output. Fixes #2055 Co-authored-by: Moroni Granja <moronigranja@gmail.com>
This commit is contained in:
1 parent
d64205ba5b
commit
5624b483fb
3 files changed
+73
-12
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import android.graphics.RectF
|
||||
|
||||
/**
|
||||
* The area of the session view that drives the guest pointer.
|
||||
*
|
||||
* The view is also the compositor output only while it shows the picture: the phone, or the
|
||||
* bottom screen. With the glasses owning the output the view is a touchpad for a scene drawn
|
||||
* elsewhere, so the whole view has to drive the pointer. Using the picture rect there would
|
||||
* confine it to the letterboxed band the scene would occupy on the phone, and the pointer could
|
||||
* not reach the scene edges.
|
||||
*/
|
||||
object PointerSpace {
|
||||
fun area(viewWidth: Int, viewHeight: Int, glassesOwnOutput: Boolean, picture: RectF?): RectF? {
|
||||
if (viewWidth <= 0 || viewHeight <= 0) return null
|
||||
if (glassesOwnOutput) return RectF(0f, 0f, viewWidth.toFloat(), viewHeight.toFloat())
|
||||
return picture
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user