Pyroxenium / Basalt

A UI Framework for CC:Tweaked
MIT License
189 stars 34 forks source link

bug: long text on button overflows the button's bounding box #48

Open luiz00martins opened 1 year ago

luiz00martins commented 1 year ago

Describe the bug

If the text (or value) in the button is longer than its width, the text will overflow the button's bounding box.

Minimal Working Example

-- Basalt configurated installer
local filePath = "/basalt.lua" --here you can change the file path default: basalt
if not(fs.exists(filePath))then
        shell.run("pastebin run ESs1mg7P packed true "..filePath:gsub(".lua", "")) -- this is an alternative to the wget command
end
local basalt = require(filePath:gsub(".lua", ""))

local main = basalt.createFrame("mainFrame")

main:addButton('button')
    :setPosition(20, 8)
    :setSize(10, 3)
    :setValue('some very very long name')

basalt.autoUpdate()

image

Expected behavior

The text would be "cut off" the bounding box of the button. image

Checklist

[✔️] I am running the latest version

NoryiE commented 1 year ago

Hm, it's a good idea and maybe i should implement this. I don't expect the user to have a longer text than the button is - but you're right i should cut it off just in case.