Here's a hack to the resize code that prevents this. Add something similar around the window.resizeTo(x,y) statement in Apple's standard code to do resizing. The code contains some size limiting code too as this also interacts
function sizeWidget(x,y)
{
if (x == window.innerWidth && y == window.innerHeight)
return;
// size limiting code
if (x<=200)
x = 200;
if (x>=440)
x = 440;
if (y<=130)
y = 130;
if (y>=340)
y = 340;
// prevent vertical resize bug
if (y>130 && y<340 && y != window.innerHeight &&
x == window.innerWidth)
window.resizeTo(x+1,y);
// finally the original resize
window.resizeTo(x,y);
}
All that's happening is that if our condition is met (height changed, width unchanged) then the widget is resized horizontally by one pixel, before being immediately resized to the desired size.
It's not perfect - a slight wobble is barely noticeable on my machine when resizing vertically, but it's nicer than the widget being chopped.
2 comments:
its really works. thanks a lot.
Bravo, what necessary words..., a brilliant idea
Post a Comment