Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: fill in both sides of the border (i.e. the full box) when a frame becomes 1-wide #53

Open
luiz00martins opened this issue Apr 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@luiz00martins
Copy link

Problem

Making a frame with borders 1-wide creates seemingly undefined behaviour (in terms of how the borders will be drawn). In general, only one side is drawn at a time, leading to the other side being "open".

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")
local W, H = main:getSize()

local frame = main:addFrame("frame")
frame:setSize(W-2, math.floor(H/2))
	frame:setPosition(2, 5)
	frame:setBackground(colors.black)
	frame:setBorder(colors.white)

local animation = main:addAnimation("animation")
	:setObject(frame)
	:size(1, math.floor(H/2), 0.5, 0.5)

animation:play()

basalt.autoUpdate()
output.mp4

Desired Solution

When becoming one-wide, a frame with border of color X should be completely filled by color X (simulating drawing on both sides of the border).

Minimal Working Example (Simulation)

-- 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")
local W, H = main:getSize()

local frame = main:addFrame("frame")
frame:setSize(W-2, math.floor(H/2))
	frame:setPosition(2, 5)
	frame:setBackground(colors.black)
	frame:setBorder(colors.white)

local animation = main:addAnimation("animation")
	:setObject(frame)
	:size(2, math.floor(H/2), 0.5, 0.5)
	:onDone(function()
		frame:setSize(1, math.floor(H/2))
		frame:setBackground(colors.white)
	end)

animation:play()

basalt.autoUpdate()
output.mp4
@luiz00martins luiz00martins added the enhancement New feature or request label Apr 2, 2023
@NoryiE
Copy link
Collaborator

NoryiE commented Apr 30, 2023

Hello. Sorry for not responding, i thought i had already responded.. >.<! I will fix this in basalt 1.7, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants