From e31add95ccdeaa16643e7157350b16deb9350023 Mon Sep 17 00:00:00 2001 From: Suphon Thanakornpakapong Date: Fri, 13 May 2022 23:47:15 +0700 Subject: [PATCH] Fix smartspace width when scaling --- lawnchair/src/app/lawnchair/smartspace/BcSmartspaceView.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lawnchair/src/app/lawnchair/smartspace/BcSmartspaceView.kt b/lawnchair/src/app/lawnchair/smartspace/BcSmartspaceView.kt index 52ee3b7beb..44c20f10be 100644 --- a/lawnchair/src/app/lawnchair/smartspace/BcSmartspaceView.kt +++ b/lawnchair/src/app/lawnchair/smartspace/BcSmartspaceView.kt @@ -78,8 +78,9 @@ class BcSmartspaceView @JvmOverloads constructor( } val scale = height.toFloat() / smartspaceHeight.toFloat() + val width = (MeasureSpec.getSize(widthMeasureSpec).toFloat() / scale).roundToInt() super.onMeasure( - makeMeasureSpec((height.toFloat() / scale).roundToInt(), EXACTLY), + makeMeasureSpec(width, EXACTLY), makeMeasureSpec(smartspaceHeight, EXACTLY) ) scaleX = scale