mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 13:26:02 +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,30 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
import android.graphics.RectF
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertSame
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [28], manifest = Config.NONE)
|
||||
class PointerSpaceTest {
|
||||
private val phonePicture = RectF(0f, 896f, 1080f, 1503f)
|
||||
|
||||
@Test fun theGlassesMakeTheWholeViewThePointerArea() {
|
||||
assertEquals(RectF(0f, 0f, 1080f, 2400f),
|
||||
PointerSpace.area(1080, 2400, glassesOwnOutput = true, phonePicture))
|
||||
}
|
||||
|
||||
@Test fun theViewThatShowsThePictureUsesItsPictureRect() {
|
||||
assertSame(phonePicture, PointerSpace.area(2400, 1504, glassesOwnOutput = false, phonePicture))
|
||||
}
|
||||
|
||||
@Test fun aViewWithoutSizeHasNoPointerArea() {
|
||||
assertNull(PointerSpace.area(0, 2400, glassesOwnOutput = true, phonePicture))
|
||||
assertNull(PointerSpace.area(1080, 0, glassesOwnOutput = false, phonePicture))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user