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

Cache GuiInset after the value has been set #55

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

TheyCallMeRyan
Copy link
Contributor

See: #54

getMouseLocation should now always return the true location.

…a test case. Did not work in the demo, so implemented GuiInset fix. Associated demo case now works.
… it causes an error. This should be a user decision (Main cases are Delete / Backspace / any of the F1-F12).
@SirMallard
Copy link
Collaborator

Thanks for addidng this. Just to check, there isn't going to be a possibility in the future where the GuiInset is 0, because otherwise it will call the set function every time you request the mouse location?

end

function widgets.getGuiInset()
return widgets.GuiInset or widgets.setGuiInset()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if widgets.GuiInset is 0 then it will fetch the inset every time rather than caching it. Is it worth changing the check to be:

return widgets.GuiInset ~= nil and widgets.GuiInset or widgets.setGuiInset()

Just in case future updates change this behaviour?

@SirMallard SirMallard merged commit f00b7e0 into Michael-48:main Jul 5, 2024
@SirMallard SirMallard linked an issue Jul 5, 2024 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

widgets.getMouseLocation Returning Incorrect Values
2 participants