Recalculate item size when adding a new scrollbar to a columnlistarea object

This commit is contained in:
Kenny Shields 2014-08-23 15:00:05 -04:00
parent e4c518e2f0
commit 01163b2ab9

View File

@ -241,9 +241,12 @@ function newobject:CalculateSize()
end end
self.extraheight = self.itemheight - height self.extraheight = self.itemheight - height
if not self.vbar then if not self.vbar then
table.insert(self.internals, loveframes.objects["scrollbody"]:new(self, "vertical")) local newbar = loveframes.objects["scrollbody"]:new(self, "vertical")
table.insert(self.internals, newbar)
self.vbar = true self.vbar = true
self:GetVerticalScrollBar().autoscroll = parent.autoscroll newbar.autoscroll = parent.autoscroll
self.itemwidth = self.itemwidth + newbar.width
self.extrawidth = self.itemwidth - width
end end
else else
if self.vbar then if self.vbar then
@ -265,9 +268,12 @@ function newobject:CalculateSize()
end end
self.extrawidth = self.itemwidth - width self.extrawidth = self.itemwidth - width
if not self.hbar then if not self.hbar then
table.insert(self.internals, loveframes.objects["scrollbody"]:new(self, "horizontal")) local newbar = loveframes.objects["scrollbody"]:new(self, "horizontal")
table.insert(self.internals, newbar)
self.hbar = true self.hbar = true
self:GetHorizontalScrollBar().autoscroll = parent.autoscroll newbar.autoscroll = parent.autoscroll
self.itemheight = self.itemheight + newbar.height
self.extraheight = self.itemheight - height
end end
else else
if self.hbar then if self.hbar then