mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 06:25:01 +00:00
LibGfx: Add Gfx::TextAttributes (and use it in GUI::TextDocumentSpan)
This commit is contained in:
parent
0d44ee6f2b
commit
05f5d0dda3
11 changed files with 127 additions and 83 deletions
|
@ -496,13 +496,13 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
for (auto& span : document().spans()) {
|
||||
if (!span.range.contains(physical_position))
|
||||
continue;
|
||||
color = span.color;
|
||||
if (span.bold) {
|
||||
color = span.attributes.color;
|
||||
if (span.attributes.bold) {
|
||||
if (auto bold_font = Gfx::FontDatabase::the().get(font->family(), font->presentation_size(), 700))
|
||||
font = bold_font;
|
||||
}
|
||||
background_color = span.background_color;
|
||||
underline = span.is_underlined;
|
||||
background_color = span.attributes.background_color;
|
||||
underline = span.attributes.underline;
|
||||
break;
|
||||
}
|
||||
character_rect.set_width(font->glyph_width(code_point) + font->glyph_spacing());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue