dart:math
庫中MutableRectangle構造函數
的用法介紹如下。
用法:
MutableRectangle<T extends num>(
T left,
T top,
T width,
T height
)
創建一個由 (left, top)
和 (left+width, top+height)
跨越的可變矩形。
該矩形包含 x 坐標在 left
和 left + width
之間以及 y 坐標在 top
和 top + height
之間的點,兩者都包括在內。
width
和 height
應該是非負數。如果width
或height
為負數,則將它們鉗位為零。
如果 width
和 height
為零,則 "rectangle" 僅包含單個點 (left, top)
。
例子:
var rectangle = MutableRectangle(20, 50, 300, 600);
print(rectangle); // Rectangle (20, 50) 300 x 600
print(rectangle.left); // 20
print(rectangle.top); // 50
print(rectangle.right); // 320
print(rectangle.bottom); // 650
// Change rectangle width and height.
rectangle.width = 200;
rectangle.height = 100;
print(rectangle); // Rectangle (20, 50) 200 x 100
print(rectangle.left); // 20
print(rectangle.top); // 50
print(rectangle.right); // 220
print(rectangle.bottom); // 150
相關用法
- Dart MutableRectangle.fromPoints用法及代碼示例
- Dart MapMixin.containsKey用法及代碼示例
- Dart Map.update用法及代碼示例
- Dart MidiInputMap.clear用法及代碼示例
- Dart Match.groups用法及代碼示例
- Dart MapEntry.value用法及代碼示例
- Dart MidiInputMap.putIfAbsent用法及代碼示例
- Dart MimeTypeArray.first用法及代碼示例
- Dart Map.addEntries用法及代碼示例
- Dart MapMixin.update用法及代碼示例
- Dart MirrorsUsed用法及代碼示例
- Dart MirrorsUsed.metaTargets用法及代碼示例
- Dart MapView.containsValue用法及代碼示例
- Dart MidiInputMap.containsKey用法及代碼示例
- Dart Map.removeWhere用法及代碼示例
- Dart Map.from用法及代碼示例
- Dart Map.remove用法及代碼示例
- Dart Map.fromIterable用法及代碼示例
- Dart MapMixin.putIfAbsent用法及代碼示例
- Dart MapMixin.addAll用法及代碼示例
- Dart MapMixin.clear用法及代碼示例
- Dart Match用法及代碼示例
- Dart MapMixin.addEntries用法及代碼示例
- Dart MidiInputMap.forEach用法及代碼示例
- Dart MapView.clear用法及代碼示例
注:本文由純淨天空篩選整理自dart.dev大神的英文原創作品 MutableRectangle<T extends num> constructor。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。