We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Due to weird chromium behavior, Alt+Tab at fullscreen resizes the window a bit, then subtitle disappears.
The resize event is handled by resizeWithTimeout() in subtitles-octopus.js, which is:
resizeWithTimeout()
self.resizeWithTimeout = function () { self.resize(); setTimeout(self.resize, 100); };
I don't understand the purpose to resize twice, but the resize() call do this:
resize()
// --snip-- if ( self.canvas.width != width || self.canvas.height != height || self.canvas.style.top != top || self.canvas.style.left != left ) { // --snip-- self.canvas.width = width; self.canvas.height = height; // --snip-- } // --snip--
The canvas will clear all contents and context if its width and height is assigned, which causes subtitle disappear.
And these conditions in the if seems not work, for width and height are float while self.canvas.width and self.canvas.height are int.
if
width
height
self.canvas.width
self.canvas.height
if ( self.canvas.width != Math.floor(width) || self.canvas.height != Math.floor(height) || self.canvas.style.top != top + 'px' || self.canvas.style.left != left + 'px' }
just remove setTimeout(self.resize, 100);, this works fine for me.
setTimeout(self.resize, 100);
In src/post-worker.js, find function onMessageFromMainEmscriptenThread(), then switch ... case 'canvas', then self.getRenderMethod()();, change it to:
src/post-worker.js
function onMessageFromMainEmscriptenThread()
switch ... case 'canvas'
self.getRenderMethod()();
`self.getRenderMethod()(true);`
to force render when resizing.
The text was updated successfully, but these errors were encountered:
I didn't notice this PR when I was writing the issue #132 But hope these will help someone. :)
Sorry, something went wrong.
No branches or pull requests
Due to weird chromium behavior, Alt+Tab at fullscreen resizes the window a bit, then subtitle disappears.
The resize event is handled by
resizeWithTimeout()
in subtitles-octopus.js, which is:I don't understand the purpose to resize twice, but the
resize()
call do this:The canvas will clear all contents and context if its width and height is assigned, which causes subtitle disappear.
And these conditions in the
if
seems not work, forwidth
andheight
are float whileself.canvas.width
andself.canvas.height
are int.One workaround:
One more workaround:
just remove
setTimeout(self.resize, 100);
, this works fine for me.One more workaround:
In
src/post-worker.js
, findfunction onMessageFromMainEmscriptenThread()
, thenswitch ... case 'canvas'
, thenself.getRenderMethod()();
, change it to:`self.getRenderMethod()(true);`
to force render when resizing.
The text was updated successfully, but these errors were encountered: