From 908d9458c7496c0d7828db349f57c84703d4545f Mon Sep 17 00:00:00 2001 From: Christopher Dumas Date: Thu, 6 Jun 2019 08:34:13 -0700 Subject: WindowServer: New API for Scaled Blit --- SharedGraphics/Painter.cpp | 4 ++-- SharedGraphics/Painter.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'SharedGraphics') diff --git a/SharedGraphics/Painter.cpp b/SharedGraphics/Painter.cpp index c1c85c6deb..31d505fc9e 100644 --- a/SharedGraphics/Painter.cpp +++ b/SharedGraphics/Painter.cpp @@ -204,9 +204,9 @@ void Painter::draw_bitmap(const Point& p, const GlyphBitmap& bitmap, Color color } } -void Painter::blit_scaled(const Point& position, const GraphicsBitmap& source, const Rect& src_rect, float hscale, float vscale) +void Painter::blit_scaled(const Rect& dst_rect_raw, const GraphicsBitmap& source, const Rect& src_rect, float hscale, float vscale) { - auto dst_rect = Rect(position, src_rect.size()).translated(translation()); + auto dst_rect = Rect(dst_rect_raw.location(), dst_rect_raw.size()).translated(translation()); auto clipped_rect = dst_rect.intersected(clip_rect()); if (clipped_rect.is_empty()) return; diff --git a/SharedGraphics/Painter.h b/SharedGraphics/Painter.h index 66d4904115..9c8e275e40 100644 --- a/SharedGraphics/Painter.h +++ b/SharedGraphics/Painter.h @@ -29,7 +29,7 @@ public: void blit_dimmed(const Point&, const GraphicsBitmap&, const Rect& src_rect); void blit_tiled(const Point&, const GraphicsBitmap&, const Rect& src_rect); void blit_offset(const Point&, const GraphicsBitmap&, const Rect& src_rect, const Point&); - void blit_scaled(const Point&, const GraphicsBitmap&, const Rect&, float, float); + void blit_scaled(const Rect&, const GraphicsBitmap&, const Rect&, float, float); void draw_text(const Rect&, const StringView&, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None); void draw_text(const Rect&, const StringView&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None); void draw_glyph(const Point&, char, Color); -- cgit v1.2.3