При установке атрибута Rotation картинка выходит за рамки Imageview
Имею 2 картинки под углом 45 градусов
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.activity.CubeTestActivity">
<ImageView
android:id="@+id/horse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotationX="45"
android:background="@drawable/horse"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<ImageView
android:id="@+id/cow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/cow"
android:rotationX="-45"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
Проблема вот в чем Как сделать так чтобы картинка не выходила за границы ImageView?
Мне нужно чтоб при введении атрибутов android:rotationX картинка верхняя или нижняя сторона выравнивалась по верхней или нижней стороне imageview не выходя за его границы
