主题
Size
A 2D size with width and height.
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
width | Number | required | The horizontal extent of the size. |
height | Number | required | The vertical extent of the size. |
只读属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
aspect_ratio | float | — | Returns the aspect ratio (width / height). |
方法
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
is_infinite | bool | — | Checks if either dimension is infinite. |
is_finite | bool | — | Checks if both dimensions are finite. |
square | 'Size' | — | Creates a square Size where width and height are the same. |
from_width | 'Size' | — | Creates a Size with the given width and an infinite height. |
from_height | 'Size' | — | Creates a Size with the given height and an infinite width. |
from_radius | 'Size' | — | Creates a square Size whose width and height are twice the given radius. |
zero | — | — | Creates a Size whose width and height are both 0.0. |
infinite | — | — | Creates a Size whose width and height are both positive infinity. |
copy | 'Size' | — | 返回此对象的副本,可覆盖指定属性。 |