Fix Table stripe pattern when combining row() and rows() (#3442)

* Closes <https://github.com/emilk/egui/issues/3076>
This commit is contained in:
YgorSouza 2023-11-11 18:36:40 +01:00 committed by GitHub
parent 6a785d4b47
commit 03a1471ddb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -867,7 +867,7 @@ impl<'a> TableBody<'a> {
widths: self.widths,
max_used_widths: self.max_used_widths,
col_index: 0,
striped: self.striped && idx % 2 == 0,
striped: self.striped && (idx + self.row_nr) % 2 == 0,
height: row_height_sans_spacing,
},
);
@ -945,7 +945,7 @@ impl<'a> TableBody<'a> {
widths: self.widths,
max_used_widths: self.max_used_widths,
col_index: 0,
striped: self.striped && row_index % 2 == 0,
striped: self.striped && (row_index + self.row_nr) % 2 == 0,
height: row_height,
},
);
@ -964,7 +964,7 @@ impl<'a> TableBody<'a> {
widths: self.widths,
max_used_widths: self.max_used_widths,
col_index: 0,
striped: self.striped && row_index % 2 == 0,
striped: self.striped && (row_index + self.row_nr) % 2 == 0,
height: row_height,
},
);