From e3ee6e3b6c91838875b11cdf9300e2cbdcf0c06b Mon Sep 17 00:00:00 2001 From: Patrick Geneva Date: Tue, 11 Jan 2022 22:27:30 -0500 Subject: [PATCH 1/6] fix emote playback rate to match chrome / firefox https://github.com/SevenTV/chatterino7/issues/46#issuecomment-1010595231 --- src/messages/Image.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index 1b4f116456c..e35479e6353 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -152,8 +152,10 @@ namespace detail { if (reader.read(&image)) { QPixmap::fromImage(image); - - int duration = std::max(20, reader.nextImageDelay()); + int duration = reader.nextImageDelay(); + if (duration <= 10) + duration = 100; + duration = std::max(20, duration); frames.push_back(Frame{image, duration}); } } From 0937ee5ab6932bc1f07f9f588f751ac7162d9c03 Mon Sep 17 00:00:00 2001 From: Patrick Geneva Date: Fri, 14 Jan 2022 17:23:34 -0500 Subject: [PATCH 2/6] add comment explaining --- src/messages/Image.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index e35479e6353..b7b09835b5b 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -152,6 +152,11 @@ namespace detail { if (reader.read(&image)) { QPixmap::fromImage(image); + // It seems that browsers have special logic for fast animations. + // This implments Chrome and Firefox's behavior which uses + // a duration of 100 ms for any frames that specify a duration of <= 10 ms. + // See for more information. + // https://github.com/SevenTV/chatterino7/issues/46#issuecomment-1010595231 int duration = reader.nextImageDelay(); if (duration <= 10) duration = 100; From 94efb4c6d4fe09df2f5b5106308e51a7b56f2884 Mon Sep 17 00:00:00 2001 From: Patrick Geneva Date: Fri, 14 Jan 2022 19:04:38 -0500 Subject: [PATCH 3/6] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d85484d8b7..21fd4185969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unversioned - Major: Added customizable shortcuts. (#2340) +- Minor: Make animated emote playback speed match browser (#3506) - Minor: Added middle click split to open in browser (#3356) - Minor: Added new search predicate to filter for messages matching a regex (#3282) - Minor: Add `{channel.name}`, `{channel.id}`, `{stream.game}`, `{stream.title}`, `{my.id}`, `{my.name}` placeholders for commands (#3155) From 988c61742e6ca5027c834214c745f4153fdf84bf Mon Sep 17 00:00:00 2001 From: Patrick Geneva Date: Sat, 15 Jan 2022 12:27:50 -0500 Subject: [PATCH 4/6] Update CHANGELOG.md Co-authored-by: pajlada --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21fd4185969..7b786c60599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Unversioned - Major: Added customizable shortcuts. (#2340) -- Minor: Make animated emote playback speed match browser (#3506) +- Minor: Make animated emote playback speed match browser (Firefox and Chrome) behaviour. (#3506) - Minor: Added middle click split to open in browser (#3356) - Minor: Added new search predicate to filter for messages matching a regex (#3282) - Minor: Add `{channel.name}`, `{channel.id}`, `{stream.game}`, `{stream.title}`, `{my.id}`, `{my.name}` placeholders for commands (#3155) From fdf70a63a9a7775fa7191f9db87e4ba3a9bcf675 Mon Sep 17 00:00:00 2001 From: Patrick Geneva Date: Sat, 15 Jan 2022 12:27:55 -0500 Subject: [PATCH 5/6] Update src/messages/Image.cpp Co-authored-by: pajlada --- src/messages/Image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index b7b09835b5b..98f7765b2d4 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -155,7 +155,7 @@ namespace detail { // It seems that browsers have special logic for fast animations. // This implments Chrome and Firefox's behavior which uses // a duration of 100 ms for any frames that specify a duration of <= 10 ms. - // See for more information. + // See http://webkit.org/b/36082 for more information. // https://github.com/SevenTV/chatterino7/issues/46#issuecomment-1010595231 int duration = reader.nextImageDelay(); if (duration <= 10) From aa05bb3277c9833658473a2d77b1cd48cd421d09 Mon Sep 17 00:00:00 2001 From: Patrick Geneva Date: Sat, 15 Jan 2022 12:27:59 -0500 Subject: [PATCH 6/6] Update src/messages/Image.cpp Co-authored-by: pajlada --- src/messages/Image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index 98f7765b2d4..89e382fc399 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -153,7 +153,7 @@ namespace detail { { QPixmap::fromImage(image); // It seems that browsers have special logic for fast animations. - // This implments Chrome and Firefox's behavior which uses + // This implements Chrome and Firefox's behavior which uses // a duration of 100 ms for any frames that specify a duration of <= 10 ms. // See http://webkit.org/b/36082 for more information. // https://github.com/SevenTV/chatterino7/issues/46#issuecomment-1010595231