fixed styles

This commit is contained in:
Mikayla Maki
2022-08-02 17:31:40 -07:00
parent 2a5eafcc61
commit 86406153bd
+10 -16
View File
@@ -368,14 +368,7 @@ impl TerminalEl {
let fg = convert_color(&fg, &style.colors, modal); let fg = convert_color(&fg, &style.colors, modal);
let underline = flags let underline = flags
.contains( .intersects(Flags::ALL_UNDERLINES)
Flags::UNDERLINE
| Flags::DOUBLE_UNDERLINE
| Flags::DOTTED_UNDERLINE
| Flags::DASHED_UNDERLINE
| Flags::UNDERCURL
| Flags::ALL_UNDERLINES,
)
.then(|| Underline { .then(|| Underline {
color: Some(fg), color: Some(fg),
squiggly: flags.contains(Flags::UNDERCURL), squiggly: flags.contains(Flags::UNDERCURL),
@@ -386,11 +379,11 @@ impl TerminalEl {
let mut properties = Properties::new(); let mut properties = Properties::new();
if indexed if indexed
.flags .flags
.contains(Flags::BOLD | Flags::BOLD_ITALIC | Flags::DIM_BOLD) .intersects(Flags::BOLD | Flags::BOLD_ITALIC | Flags::DIM_BOLD)
{ {
properties = *properties.weight(Weight::BOLD); properties = *properties.weight(Weight::BOLD);
} }
if indexed.flags.contains(Flags::ITALIC | Flags::BOLD_ITALIC) { if indexed.flags.intersects(Flags::ITALIC | Flags::BOLD_ITALIC) {
properties = *properties.style(Italic); properties = *properties.style(Italic);
} }
@@ -598,12 +591,13 @@ impl Element for TerminalEl {
cells.extend( cells.extend(
content content
.display_iter .display_iter
.filter(|ic| { //TODO: Add this once there's a way to retain empty lines
!ic.flags.contains(Flags::HIDDEN) // .filter(|ic| {
&& !(ic.bg == Named(NamedColor::Background) // !ic.flags.contains(Flags::HIDDEN)
&& ic.c == ' ' // && !(ic.bg == Named(NamedColor::Background)
&& !ic.flags.contains(Flags::INVERSE)) // && ic.c == ' '
}) // && !ic.flags.contains(Flags::INVERSE))
// })
.map(|ic| IndexedCell { .map(|ic| IndexedCell {
point: ic.point.clone(), point: ic.point.clone(),
cell: ic.cell.clone(), cell: ic.cell.clone(),