You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Renderer (e.g. Renderer.PlaceHorizontal and Renderer.PlaceVertical) places text using inverse of correct padding for any positions other than 0 (left/top), 1 (right/bottom), and 0.5 (due to symmetry)
Setup
Please complete the following information along with version numbers, if applicable.
OS: Arch Linux
Shell: bash
Terminal Emulator: konsole
Terminal Multiplexer: tmux
Locale: en_US.UTF-8
Versions: 0.9.1 and (at time of submission) the latest commit on master
Go Version: go version go1.21.1 linux/amd64
To Reproduce
Steps to reproduce the behavior:
In a new directory, save the given source code as lg_test.go
Run go mod init lgtest
Run go get github.com/charmbracelet/[email protected] (or, at time-of-submission, go get github.com/charmbracelet/lipgloss@master)
Run go test .
Notice that test cases 2 and 5 of both tests fail. This is due to the left, right, top, and bottom placement being special-cased, while all positions in between use logic which is exactly backwards for calculating the padding (e.g.
The text was updated successfully, but these errors were encountered:
prestidigitator-mt
changed the title
Renderer places text f
Renderer places text using inverse of correct padding for any positions other than 0 (left/top), 1 (right/bottom), and 0.5 (due to symmetry)
Oct 17, 2023
prestidigitator-mt
changed the title
Renderer places text using inverse of correct padding for any positions other than 0 (left/top), 1 (right/bottom), and 0.5 (due to symmetry)
Text alignment logic is backwards for non-special-cases
Oct 17, 2023
ndfsa
added a commit
to ndfsa/lipgloss
that referenced
this issue
Sep 19, 2024
Describe the bug
Renderer (e.g. Renderer.PlaceHorizontal and Renderer.PlaceVertical) places text using inverse of correct padding for any positions other than 0 (left/top), 1 (right/bottom), and 0.5 (due to symmetry)
Setup
Please complete the following information along with version numbers, if applicable.
master
go version go1.21.1 linux/amd64
To Reproduce
Steps to reproduce the behavior:
lg_test.go
go mod init lgtest
go get github.com/charmbracelet/[email protected]
(or, at time-of-submission,go get github.com/charmbracelet/lipgloss@master
)go test .
lipgloss/position.go
Lines 83 to 85 in b0605d3
Source Code
Expected behavior
All tests pass.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: