summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-04-07 16:56:51 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-07 17:06:02 +0200
commit36d9943d3a1d46957cd9e2dd6b32b85683f8f450 (patch)
treec028101e7463447b5422ce13fbdaa247906e5e65 /Userland/Libraries
parentcb3a2b347b783e56c3851f75532689b2b6754243 (diff)
downloadserenity-36d9943d3a1d46957cd9e2dd6b32b85683f8f450.zip
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp5
1 files 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();
});
}