Skip to content

fix(avatar): correct grid rendering for odd sizes and eliminate extra margins (#12) #13

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

Merged
merged 1 commit into from
Apr 6, 2025

Conversation

MuhammadSaim
Copy link
Owner

This PR resolves Issue #12 which affects avatar rendering when using high or odd gridSize values.

Problem

  • For odd gridSize values (e.g., 9), the center column is skipped during mirroring, causing asymmetry.
  • For larger even grid sizes (e.g., 10), there's a small margin or padding on the right and bottom of the image.

What’s Changed

  • Added support for drawing the center column when gridSize is odd
  • Improved drawPixel logic to clamp within image bounds
  • Ensured the avatar fills the image completely without leaving empty margins

@MuhammadSaim MuhammadSaim merged commit 61174f6 into master Apr 6, 2025
@MuhammadSaim MuhammadSaim deleted the fix/avatar-grid-mirroring-and-margins branch April 6, 2025 05:59
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.

1 participant