Chatterino / chatterino-browser-ext

26 stars 17 forks source link

Fixed position bug when zooming [Chrome] #28

Closed mfmarlow closed 3 years ago

mfmarlow commented 3 years ago

Added devicepixelratio to message passed to Chatterino app. This allows the app to adjust the x position of the attached window even when the host window is zoomed in (a problem in Chrome).

Also added an additional delayed call to queryChatRect because, on Chrome, Twitch has an animation when you zoom that takes about 475ms to complete. This makes it so you don't have to resize/click on the window to adjust chat size after zooming.

Goes with: https://github.com/Chatterino/chatterino2/pull/1936

ALazyMeme commented 3 years ago

Could you please give instructions on how to reproduce the bug? I am trying to zoom in on Chrome and have zero issues with it resizing.

mfmarlow commented 3 years ago

@alazymeme Try zooming and after each zoom increment, click on the screen (or switch tabs and switch back) to trigger a new attach event. At some zoom levels, the code I wrote in #19 takes effect (which has a bug that this PR fixes). At zoom levels where there is no issue (except 100% zoom), it is defaulting to the previous window location algorithm (static: right side of the screen - chat width) which would be much more obvious if you were using FFZ's swapped sidebars layout.

ALazyMeme commented 3 years ago

@pajlada merge pls