mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibPDF+MacPDF: Clip text, and add a debug option for disabling it
This commit is contained in:
parent
90fdf738a1
commit
a0462f495c
Notes:
sideshowbarker
2024-07-17 05:05:51 +09:00
Author: https://github.com/nico
Commit: a0462f495c
Pull-request: https://github.com/SerenityOS/serenity/pull/22871
Reviewed-by: https://github.com/ADKaster ✅
7 changed files with 30 additions and 0 deletions
|
@ -1011,6 +1011,10 @@ PDFErrorOr<void> Renderer::show_text(ByteString const& string)
|
|||
if (!text_state().font)
|
||||
return Error::rendering_unsupported_error("Can't draw text because an invalid font was in use");
|
||||
|
||||
OwnPtr<ClipRAII> clip_raii;
|
||||
if (m_rendering_preferences.clip_text)
|
||||
clip_raii = make<ClipRAII>(*this);
|
||||
|
||||
auto start_position = Gfx::FloatPoint { 0.0f, 0.0f };
|
||||
auto end_position = TRY(text_state().font->draw_string(m_painter, start_position, string, *this));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue