diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-14 19:35:10 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-14 19:35:10 +0200 |
commit | 007237045980b12d524b36933885f540e1b814af (patch) | |
tree | f954fea55d843bb1deeabe4e5a62475e421367f8 /Libraries/LibWeb/Loader/ImageLoader.cpp | |
parent | 73c9f7ebf4ae07492367c1c39f940603046b780e (diff) | |
download | serenity-007237045980b12d524b36933885f540e1b814af.zip |
LibWeb: Don't animate images outside the visible viewport :^)
Diffstat (limited to 'Libraries/LibWeb/Loader/ImageLoader.cpp')
-rw-r--r-- | Libraries/LibWeb/Loader/ImageLoader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Loader/ImageLoader.cpp b/Libraries/LibWeb/Loader/ImageLoader.cpp index a6b3ecae58..c581242d4c 100644 --- a/Libraries/LibWeb/Loader/ImageLoader.cpp +++ b/Libraries/LibWeb/Loader/ImageLoader.cpp @@ -87,6 +87,9 @@ void ImageLoader::resource_did_load() void ImageLoader::animate() { + if (!m_visible_in_viewport) + return; + auto* decoder = image_decoder(); ASSERT(decoder); |