Add OSC opacity adjustment

This commit is contained in:
KikiManjaro
2022-07-31 17:35:28 +02:00
committed by Niccolò Betto
parent d129fb09cd
commit 3407f6d530
7 changed files with 49 additions and 1 deletions

View File

@ -79,6 +79,7 @@ abstract class OnScreenButton(
buttonSymbolPaint.apply {
textSize = size
textAlign = Paint.Align.LEFT
alpha = (config.opacity / 100.0 * 255).toInt()
getTextBounds(text, 0, text.length, textBoundsRect)
}
canvas.drawText(text, x - textBoundsRect.width() / 2f - textBoundsRect.left, y + textBoundsRect.height() / 2f - textBoundsRect.bottom, buttonSymbolPaint)
@ -88,6 +89,7 @@ abstract class OnScreenButton(
val bounds = currentBounds
drawable.apply {
this.bounds = bounds
alpha = (config.opacity / 100.0 * 255).toInt()
draw(canvas)
}