0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 00:01:51 -05:00

🐛 Fix problem with reverse config in flex

This commit is contained in:
alonso.torres 2025-03-07 09:23:07 +01:00
parent 97fb1e00c2
commit ba4554da79
3 changed files with 16 additions and 8 deletions

View file

@ -502,8 +502,10 @@
(defn translate-layout-flex-dir
[flex-dir]
(case flex-dir
:row 0
:column 1))
:row 0
:row-reverse 1
:column 2
:column-reverse 3))
(defn translate-layout-align-items
[align-items]

View file

@ -145,11 +145,13 @@ Shadow styles are serialized as `u8`:
## Layout - Direction
| Value | Field |
| ----- | -------|
| 0 | Row |
| 1 | Column |
| \_ | error |
| Value | Field |
| ----- | --------------|
| 0 | Row |
| 1 | RowReverse |
| 2 | Column |
| 3 | ColumnReverse |
| \_ | error |
## Layout - Align Items

View file

@ -9,14 +9,18 @@ pub enum Layout {
#[derive(Debug, Clone, PartialEq)]
pub enum Direction {
Row,
RowReverse,
Column,
ColumnReverse,
}
impl Direction {
pub fn from_u8(value: u8) -> Self {
match value {
0 => Self::Row,
1 => Self::Column,
1 => Self::RowReverse,
2 => Self::Column,
3 => Self::ColumnReverse,
_ => unreachable!(),
}
}