NoctisFalco Posted November 24, 2020 Share Posted November 24, 2020 An option's height is not recalculated when a texture is specified unlike in ISRadioButtons. Steps to reproduce: Create an ISTickBox UI element, add some options with textures: tickBox:addOption("option", data, texture) The fix is simple: function ISTickBox:addOption(name, data, texture) table.insert(self.options, name); self.textures[self.optionCount] = texture; self.optionData[self.optionCount] = data; self.optionsIndex[self.optionCount] = name; self.optionCount = self.optionCount + 1; -- START OF FIX if texture then self.itemHgt = math.max(self.boxSize, self.fontHgt, self.textureSize) + self.itemGap end -- END OF FIX self:setHeight(#self.options * self.itemHgt); if self.autoWidth then local w = self.leftMargin + self.boxSize + self.textGap + getTextManager():MeasureStringX(self.font, name) if texture then w = w + 32; end if w > self:getWidth() then self:setWidth(w) end end return self.optionCount - 1; end -- And in the constructor function ISTickBox:new(...) ... o.textureSize = 20 ... end Just to be consistent with the ISRadioButtons widget. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now