From 3fc09f0953967123cbede216aa54d17474ea7fb7 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Fri, 17 Mar 2023 18:48:57 +0100 Subject: [PATCH] Add `OnScreenButton` properties' missing comments --- .../emu/skyline/input/onscreen/OnScreenButton.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/emu/skyline/input/onscreen/OnScreenButton.kt b/app/src/main/java/emu/skyline/input/onscreen/OnScreenButton.kt index 19681cc3..7e913bad 100644 --- a/app/src/main/java/emu/skyline/input/onscreen/OnScreenButton.kt +++ b/app/src/main/java/emu/skyline/input/onscreen/OnScreenButton.kt @@ -51,13 +51,24 @@ abstract class OnScreenButton( private val relativeWidth get() = defaultRelativeWidth * config.globalScale private val relativeHeight get() = defaultRelativeHeight * config.globalScale + /** + * The width of the view this button is in, populated by the view during draw + */ var width = 0 + + /** + * The height of the view this button is in, populated by the view during draw + */ var height = 0 + /** + * The height of the view this button is in, adjusted to an arbitrary aspect ratio used during configuration + */ protected val adjustedHeight get() = width / CONFIGURED_ASPECT_RATIO /** - * Buttons should be at bottom when device have large height than [adjustedHeight] + * The difference between the view height and the adjusted view height. + * This is used to offset the buttons to the bottom of the screen when the view height is larger than [adjustedHeight] */ protected val heightDiff get() = (height - adjustedHeight).coerceAtLeast(0f)