1
0
Fork 0

canvas.gui.ScrollArea: check for valid content bounding box.

This commit is contained in:
Thomas Geymayer 2014-03-24 00:18:29 +01:00
parent f90ecf08d2
commit 04c40a4232

View file

@ -45,6 +45,11 @@ gui.widgets.ScrollArea = {
{ {
# TODO only update on content resize # TODO only update on content resize
var bb = me.getContent().getTransformedBounds(); var bb = me.getContent().getTransformedBounds();
if( bb[2] < bb[0] or bb[3] < bb[1] )
# Do nothing with invalid bounding box (probably no content yet)
return me;
var w = bb[2] - bb[0]; var w = bb[2] - bb[0];
var h = bb[3] - bb[1]; var h = bb[3] - bb[1];