From 36d9943d3a1d46957cd9e2dd6b32b85683f8f450 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 7 Apr 2022 16:56:51 +0200 Subject: [PATCH] LibWeb: Fix logic mistake in CRC2D's default_source_size() If the source has a bitmap, we should indeed use the bitmap's size instead of always using the source's own size. --- Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index b369f386f6..0d410a4b23 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -102,9 +102,10 @@ static void default_source_size(CanvasImageSource const& image, float& source_wi if (source->bitmap()) { source_width = source->bitmap()->width(); source_height = source->bitmap()->height(); + } else { + source_width = source->width(); + source_height = source->height(); } - source_width = source->width(); - source_height = source->height(); }); }