IntRect

interface IntRect : ComposableProperties<ERROR CLASS: Symbol not found for androidx.compose.ui.unit.IntRect>

封装 Jetpack Compose 的 androidx.compose.ui.unit.IntRect,表示一个由整型(Int)坐标定义的不可变、二维、轴对齐的矩形区域。

这个类通常用于描述UI元素在屏幕上以像素为单位的精确边界。它由四个整数值定义:getLeftgetTopgetRightgetBottom

Author

M8Test, [email protected], https://m8test.com

See also

androidx.compose.ui.unit.IntRect

Functions

Link copied to clipboard
abstract fun getBottom(): Int

获取矩形下边缘的y坐标。

Link copied to clipboard
abstract fun getCenterX(): Int

获取矩形中心点的x坐标。 计算方式为 left + width / 2

Link copied to clipboard
abstract fun getCenterY(): Int

获取矩形中心点的y坐标。 计算方式为 top + height / 2

Link copied to clipboard
abstract fun getHeight(): Int

获取矩形的高度。 计算方式为 bottom - top

Link copied to clipboard
abstract fun getLeft(): Int

获取矩形左边缘的x坐标。

Link copied to clipboard
abstract fun getRandomPointInCenterArea(percentage: Int): PairWrapper<Int, Int>

获取矩形中心区域内的一个随机坐标点。

Link copied to clipboard
abstract fun getRight(): Int

获取矩形右边缘的x坐标。

Link copied to clipboard
abstract fun getTop(): Int

获取矩形上边缘的y坐标。

Link copied to clipboard
abstract fun getWidth(): Int

获取矩形的宽度。 计算方式为 right - left

Link copied to clipboard
abstract fun setBottom(bottom: Int)

设置矩形下边缘的y坐标。

Link copied to clipboard
abstract fun setLeft(left: Int)

设置矩形左边缘的x坐标。

Link copied to clipboard
abstract fun setRight(right: Int)

设置矩形右边缘的x坐标。

Link copied to clipboard
abstract fun setTop(top: Int)

设置矩形上边缘的y坐标。