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

Have text:pos(x, y) position right-justified texts properly #2213

Open
Dev-Roland opened this issue Jul 12, 2022 · 1 comment
Open

Have text:pos(x, y) position right-justified texts properly #2213

Dev-Roland opened this issue Jul 12, 2022 · 1 comment

Comments

@Dev-Roland
Copy link

Issue:

Right-aligned objects disappear when the self:pos(x, y) function is used on them.

Steps to Reproduce:

local texts = require('texts')
local text = texts.new('Hello world')
text:pos(100,100)
text:right_justified(true)
text:show() -- now you see me
coroutine.schedule(function()
    text:pos(110, 110) -- now you don't
end, 3)

Expected Behavior

The text would not disappear and the text's top-right corner would be at the x/y position passed into the pos function.

@RubenatorX
Copy link
Collaborator

Thank you for documenting the bug, but I rather doubt we'd be willing to change this at this point in v4 because it has the potential to break any addons that have gone around the bug.
How to get around the bug:
When setting position while right justified, subtract windower.ui_x_res from the x position before setting it.

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

No branches or pull requests

2 participants