1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:57:44 +00:00

LibWeb: Remove SetFont painting command

It was only used in ImagePaintable for alt text and now it is replaced
by saving font inside DrawText command.
This commit is contained in:
Aliaksandr Kalenik 2024-01-25 20:10:12 +01:00 committed by Andreas Kling
parent d85a0e306a
commit a319037706
7 changed files with 1 additions and 46 deletions

View file

@ -207,18 +207,6 @@ void RecordingPainter::draw_line(Gfx::IntPoint from, Gfx::IntPoint to, Color col
});
}
void RecordingPainter::draw_text(Gfx::IntRect const& rect, String raw_text, Gfx::TextAlignment alignment, Color color, Gfx::TextElision elision, Gfx::TextWrapping wrapping)
{
push_command(DrawText {
.rect = state().translation.map(rect),
.raw_text = move(raw_text),
.alignment = alignment,
.color = color,
.elision = elision,
.wrapping = wrapping,
});
}
void RecordingPainter::draw_text(Gfx::IntRect const& rect, String raw_text, Gfx::Font const& font, Gfx::TextAlignment alignment, Color color, Gfx::TextElision elision, Gfx::TextWrapping wrapping)
{
push_command(DrawText {
@ -281,11 +269,6 @@ void RecordingPainter::translate(Gfx::IntPoint delta)
m_state_stack.last().translation.translate(delta.to_type<float>());
}
void RecordingPainter::set_font(Gfx::Font const& font)
{
push_command(SetFont { .font = font });
}
void RecordingPainter::save()
{
m_state_stack.append(m_state_stack.last());
@ -514,9 +497,6 @@ void RecordingPainter::execute(PaintingCommandExecutor& executor)
[&](ClearClipRect const&) {
return executor.clear_clip_rect();
},
[&](SetFont const& command) {
return executor.set_font(command.font);
},
[&](PushStackingContext const& command) {
return executor.push_stacking_context(command.opacity, command.is_fixed_position, command.source_paintable_rect, command.post_transform_translation, command.image_rendering, command.transform, command.mask);
},