Commit 1944db2
committed
[rfw] Fix fontWeight not applied in release mode
FontWeight is not a real Dart enum; it is a hand-crafted class with
static const members. The previous implementation decoded fontWeight via
enumValue(), which matched strings against FontWeight.value.toString().
In AOT/release builds this is not guaranteed to be stable, so matches
silently failed and fontWeight defaulted to null (rendered as w400).
Add a dedicated ArgumentDecoders.fontWeight() method that maps strings
("w100"–"w900", "normal", "bold") and integers (100–900) to the correct
FontWeight constant using an explicit switch, without relying on
toString(). Update textStyle and strutStyle to use it.
Also fix three pre-existing bugs where absolute keys were used instead
of relative keys:
- textDirection in the sweep shader decoder
- textBaseline in textStyle
- overflow in textStyle
Fixes flutter/flutter#180223
Made-with: Cursor1 parent 73f4d49 commit 1944db2
3 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1283 | 1283 | | |
1284 | 1284 | | |
1285 | 1285 | | |
1286 | | - | |
| 1286 | + | |
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
| |||
1413 | 1413 | | |
1414 | 1414 | | |
1415 | 1415 | | |
1416 | | - | |
| 1416 | + | |
1417 | 1417 | | |
1418 | 1418 | | |
1419 | 1419 | | |
| |||
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
1430 | | - | |
| 1430 | + | |
1431 | 1431 | | |
1432 | 1432 | | |
1433 | 1433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments