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

Fix text.Caret batch and blink #971

Merged
merged 2 commits into from Oct 14, 2023
Merged

Fix text.Caret batch and blink #971

merged 2 commits into from Oct 14, 2023

Conversation

sakkee
Copy link
Contributor

@sakkee sakkee commented Oct 13, 2023

Problem

  • If no batch is provided to the text.Caret class, text.Caret won't be added to any batch.
  • When deleting the text.Caret, the blink function isn't unscheduled.

Change summary

  • In the init function of text.Caret, create the vertex list with self._batch instead of only the parameter batch, as self._batch is the text layout's batch if no batch is provided as a parameter.
  • Unschedule the blink function when deleting the Caret.

@sakkee sakkee changed the title Fix incorrect batch when creating text.Caret Fix text.Caret batch and blink Oct 13, 2023
@benmoran56 benmoran56 merged commit 20a26ab into pyglet:master Oct 14, 2023
10 checks passed
@benmoran56
Copy link
Member

Nice catch! Thank you for the PR.

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.

None yet

2 participants