Merged
Conversation
Collaborator
Author
|
@PedroSilvaAlves since you've worked in this area before please let me know if this makes sense to you also. |
ngraves95
reviewed
Mar 21, 2026
| // if progress is less than 1 then there's no "sub-bar" to draw as it would either have fractional | ||
| // pixels (not possible) or negative pixels (also not possible) fixes | ||
| // (https://github.com/ngraves95/attacktimer/issues/92) | ||
| if (progressFill <= 1) |
Owner
There was a problem hiding this comment.
Should this check for < 1 instead of <= 1? progressFill == 1 seems like a valid config to render
Collaborator
Author
There was a problem hiding this comment.
Yeah that's probably more correct, my own comment even would indicate that 😅
Collaborator
Author
|
@PedroSilvaAlves another ping, as I'd appreciate your input 😁 |
Contributor
|
Sorry for the delay, looks good to me, appreciate the fix. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As reported by #92 (but I personally didn't encounter until #87 was merged) when the HD bar is empty it will spam the logs with exceptions.
Looking at what causes this it's two things:
progressFillis0which asks for a 0 width sub imageTherefore to make the code more robust
ratiois always clamped between0and1. And whenprogressFillis less than or equal to1we should just not draw the second image. (which was what was already happening if you think about because the exception is complaining it can't draw an image).Aside: updated the copyright (git history) and formatting of the file.
Testing
A minute of gargoyle killing flicking through the settings showing the RL logs and the lack of spam :)
https://www.youtube.com/watch?v=WBdZh-M7X_c