![](http://1.bp.blogspot.com/_O_cD_lD08JM/Rj_ZKiAt50I/AAAAAAAAAAk/apASl4UHnFs/s320/Picture+2.png)
![](http://3.bp.blogspot.com/_O_cD_lD08JM/Rj_ZPCAt51I/AAAAAAAAAAs/IndrnQjakso/s320/Picture+3.png)
![](http://2.bp.blogspot.com/_O_cD_lD08JM/Rj_ZWyAt52I/AAAAAAAAAA0/HMT_kurSUu8/s320/Picture+4.png)
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