googlemaps / googlemaps/android-maps-compose

StreetView Composable is drawn outside of clipping area

Offen
#486 3 Kommentare 13 Reaktionen 1 zugewiesene Person Beansprucht von @kikoso Auf GitHub ansehen
priority: p1 type: bug
Vorherrschende Sprache
Kotlin
Sterne
1.3k
Forks
181
Ø Merge
2 T. 23 Std.
Gemergte PRs (30 T.)
18

Beschreibung

[StreetView](https://github.com/googlemaps/android-maps-compose/blob/main/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetView.kt) composable doesn't fully respect the parent's and its own clip area.

#### Environment details

We tested it in Android 13 & 14.

**Versions**:
- 4.3.0 of com.google.maps.android:maps-compose
- 1.1.2 of androidx.compose.material3:material3

#### Steps to reproduce

Put the `StreetView` inside a `Card` or `ModalBottomSheet` with rounded corners where the street view fills out to each side. The street view will be drawn outside of the rounded corners, no matter if you put `Modifier.clip` on the `StreetView` itself or the parent Composable.

Also tried adding `shape` to the `Card` and no `Modifier.clip` applied on the `StreetView`, but got the same result.

ℹ️ There was the same [bug report](https://github.com/googlemaps/android-maps-compose/issues/199) for the Composable `GoogleMap` which is `Closed` now but there is a [comment](https://github.com/googlemaps/android-maps-compose/issues/199#issuecomment-1415555634) that it still doesn't work.

#### Code example

```
Card(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(20.dp)),
){
StreetView(
modifier = Modifier
.clip(RoundedCornerShape(20.dp))
.height(200.dp),
cameraPositionState = cameraPositionState,
streetViewPanoramaOptionsFactory = {
StreetViewPanoramaOptions().position(position, StreetViewSource.OUTDOOR)
},
)
}
```

Example screenshot from a `ModalBottomSheet` with `RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp)` shape and `Modifier.clip(RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp))` applied to `StreetView`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.