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

Open
opened 2023-03-24 12:59:49 +08:00 by luiz00martins · 1 comment
luiz00martins commented 2023-03-24 12:59:49 +08:00 (Migrated from github.com)

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

### 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 ```lua -- 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](https://user-images.githubusercontent.com/43142209/227428172-6874ded8-5fb1-480f-8c27-717ebce8186a.png) ### Expected behavior The text would be "cut off" the bounding box of the button. ![image](https://user-images.githubusercontent.com/43142209/227428241-4219db36-8f5d-48ab-a370-9b3608038036.png) ### Checklist [✔️] I am running the latest version
NoryiE commented 2023-03-25 19:28:09 +08:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GitHub/Basalt#48
No description provided.