API / ui/autolayout/layoutsymboltype
ui/autolayout/layoutsymboltype
솔버 안의 심볼 종류. (원본 ui/autolayout/layoutsymboltype.js 의 LayoutSymbolType)
- Invalid: 정해지지 않은 무효 심볼.
- External: 사용자의 LayoutVariable 하나에 하나씩 대응하는 심볼.
- Slack: 부등식 제약을 등식으로 바꿀 때 더하는 슬랙 변수.
- Error: required 가 아닌 제약의 어긋난 양을 나타내는 오차 변수.
- Dummy: required 등식 제약에 붙여 지울 때 찾는 표시 변수.
- 원본은 숫자 값(0 ~ 4)을 담은 객체다. 러스트 판은 같은 값을 매긴 열거형이다.
Symbol kind inside the solver. (LayoutSymbolType of the original ui/autolayout/layoutsymboltype.js)
- Invalid: an undetermined invalid symbol.
- External: a symbol corresponding one to one with each user LayoutVariable.
- Slack: a slack variable added when turning an inequality constraint into an equality.
- Error: an error variable representing how far a non-required constraint is off.
- Dummy: a marker variable attached to a required equality constraint and looked up when removing it.
- The original is an object holding number values (0 ~ 4). The Rust version is an enum with the same values assigned.
예제Example심볼의 종류 읽기Reading a symbol's kind
use vanilla::ui::autolayout::layoutsymbol::LayoutSymbol;
use vanilla::ui::autolayout::layoutsymboltype::LayoutSymbolType;
let slack_symbol = LayoutSymbol::new(LayoutSymbolType::Slack);
assert_eq!(slack_symbol.get_type(), LayoutSymbolType::Slack);
assert_eq!(LayoutSymbol::invalid().get_type(), LayoutSymbolType::Invalid);
assert_eq!(LayoutSymbolType::Dummy as i32, 4);LayoutSymbolTypeenum traits Clone, Copy, Debug, PartialEq, Eq, Hash
솔버 안의 심볼 종류.
Symbol kind inside the solver.
| 이름Name | 값Value | 설명Description |
|---|---|---|
Invalid | 0 | 무효.Invalid. |
External | 1 | 사용자 변수.User variable. |
Slack | 2 | 슬랙 변수.Slack variable. |
Error | 3 | 오차 변수.Error variable. |
Dummy | 4 | required 등식의 표시 변수.Marker variable of a required equality. |