mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-11 08:12:26 +01:00
car: the size setting no longer scales the safe-area inset padding, which added margins on a car that reports insets
This commit is contained in:
1 parent
703d8d69e8
commit
3f393fd56f
1 file changed
+4
-2
@@ -222,8 +222,10 @@ fun CarUi() {
|
|||||||
},
|
},
|
||||||
color = MaterialTheme.colorScheme.background,
|
color = MaterialTheme.colorScheme.background,
|
||||||
) {
|
) {
|
||||||
// Insets are in video-frame pixels, so convert with the un-scaled density.
|
// Insets are video-frame pixels. Resolve them with the live (size-scaled) density,
|
||||||
val pad = with(base) {
|
// which padding() also uses, so the safe-area margin stays one fixed physical size
|
||||||
|
// at every size setting instead of growing with it and eating the screen's sides.
|
||||||
|
val pad = with(LocalDensity.current) {
|
||||||
PaddingValues(
|
PaddingValues(
|
||||||
start = insets.left.toDp(), top = insets.top.toDp(),
|
start = insets.left.toDp(), top = insets.top.toDp(),
|
||||||
end = insets.right.toDp(), bottom = insets.bottom.toDp(),
|
end = insets.right.toDp(), bottom = insets.bottom.toDp(),
|
||||||
|
|||||||
Reference in new issue
Block a user