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

Revert "LibPDF: Offset PaintStyle when painting so pattern overlaps..."

This reverts commit 8c7fc4fe6c.
This commit is contained in:
Nico Weber 2023-12-19 18:47:55 -05:00 committed by Andreas Kling
parent 1e68e484cc
commit 7cb216c95b
2 changed files with 0 additions and 13 deletions

View file

@ -293,12 +293,6 @@ RENDERER_HANDLER(path_append_rect)
void Renderer::begin_path_paint() void Renderer::begin_path_paint()
{ {
if (state().paint_style.has<NonnullRefPtr<Gfx::PaintStyle>>()) {
VERIFY(!m_original_paint_style);
m_original_paint_style = state().paint_style.get<NonnullRefPtr<Gfx::PaintStyle>>();
auto translation = Gfx::AffineTransform().translate(m_current_path.bounding_box().x(), m_current_path.bounding_box().y());
state().paint_style = { MUST(Gfx::OffsetPaintStyle::create(state().paint_style.get<NonnullRefPtr<Gfx::PaintStyle>>(), translation)) };
}
auto bounding_box = state().clipping_paths.current.bounding_box(); auto bounding_box = state().clipping_paths.current.bounding_box();
m_painter.clear_clip_rect(); m_painter.clear_clip_rect();
if (m_rendering_preferences.show_clipping_paths) { if (m_rendering_preferences.show_clipping_paths) {
@ -312,11 +306,6 @@ void Renderer::end_path_paint()
m_current_path.clear(); m_current_path.clear();
m_painter.clear_clip_rect(); m_painter.clear_clip_rect();
state().clipping_paths.current = state().clipping_paths.next; state().clipping_paths.current = state().clipping_paths.next;
if (m_original_paint_style) {
state().paint_style = m_original_paint_style.release_nonnull();
m_original_paint_style = nullptr;
}
} }
RENDERER_HANDLER(path_stroke) RENDERER_HANDLER(path_stroke)

View file

@ -173,8 +173,6 @@ private:
Gfx::AffineTransform mutable m_text_rendering_matrix; Gfx::AffineTransform mutable m_text_rendering_matrix;
HashMap<FontCacheKey, NonnullRefPtr<PDFFont>> m_font_cache; HashMap<FontCacheKey, NonnullRefPtr<PDFFont>> m_font_cache;
// Used to offset the PaintStyle's origin when rendering a pattern.
RefPtr<Gfx::PaintStyle> m_original_paint_style;
}; };
} }