Skip to content

Conversation

ysoldak
Copy link

@ysoldak ysoldak commented Jun 19, 2025

On each empty rectangle draw attempt, a new error object is created.
Instead, we can use pre-allocated one.

Context: It is very easy to try and draw an empty rectangle when drawing multiple rectangles that vary in length and/or height depending on state in app.

Related question: is it actually an error to request a zero-length or zero-height rectangle? Negative values shall probably emit and error, but why zeros emit?

@ysoldak ysoldak changed the base branch from release to dev June 19, 2025 21:54
@deadprogram
Copy link
Member

Thanks @ysoldak now merging.

@deadprogram deadprogram merged commit ea298bd into dev Jun 20, 2025
1 check passed
@deadprogram deadprogram deleted the pre-allocate-error branch June 20, 2025 17:08
@deadprogram
Copy link
Member

is it actually an error to request a zero-length or zero-height rectangle?

I think it provokes an error, but I could be wrong.

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