Skip to content

Improve Rich Text #124

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

ghzdude
Copy link
Contributor

@ghzdude ghzdude commented Feb 28, 2025

adds an extra draw method for passing in a different text renderer
adds methods for getting last width/height
fix off by one trim
simplify getting hovered element

Comment on lines -130 to +125
getContext().pushMatrix();
getContext().translate(getArea().x, getArea().y);
Object o = this.text.getHoveringElement(getContext());
getContext().popMatrix();
return o;
return this.text.getHoveringElement(context);
Copy link
Member

Choose a reason for hiding this comment

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

why are you removing the transform

Copy link
Contributor Author

@ghzdude ghzdude Mar 8, 2025

Choose a reason for hiding this comment

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

because it's already translated for the interactable/drawing methods, translating again makes it stop working
or perhaps it's because the RichText lines are untranslated

Copy link
Member

Choose a reason for hiding this comment

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

Im confused. It was working before, was it not? And you didnt change anything where it would translate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this method wasn't used previously

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nvm, this method was only used in ClientScreenHandler, but now i'm using it for the interactable/draw methods in the widget itself. using it as is caused problems with the matrix translate. ClientScreenHandler would need the translate, but the widget's internal methods don't

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.

2 participants