[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] window-setInnerExtent bug
hi list,
found this odd offset of 45 pixels in SCWindow and JSCWindow.
setInnerExtent { arg w,h; // resize window keeping top left corner
fixed
var b;
b = this.bounds;
w = w ? b.width;
if(h.isNil,{ h = b.height }, { h = h + 45 }); //+ 45 for window bar
this.bounds = Rect(b.left,b.top + (b.height - h ),w,h);
}
//--code to spot the bug...
GUI.swing
GUI.cocoa
w= GUI.window.new("asdf", Rect(128, 64, 200, 200)).front
w.setInnerExtent(200, 200) //height should not change right, 200=200?
w.bounds
//--proposed fix...
setInnerExtent { arg w,h; // resize window keeping top left corner
fixed
var b;
b = this.bounds;
w = w ? b.width;
h = h ? b.height;
this.bounds = Rect(b.left,b.top + (b.height - h), w,h);
}
only place i found it used was in MultiPageLayout:resizeToFit
setInnerExtent is an awkward name. shouldn't it be renamed resize
anyway?
_f
#|
fredrikolofsson.com klippav.org musicalfieldsforever.com
|#