Commit 61174f6
authored
fix(avatar): correct grid rendering for odd sizes and eliminate extra margins (#13)
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 margins1 parent a106a48 commit 61174f6
File tree
5 files changed
+38
-14
lines changed- arts
- example
5 files changed
+38
-14
lines changedLoading
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
76 | 92 | | |
77 | 93 | | |
78 | 94 | | |
| |||
90 | 106 | | |
91 | 107 | | |
92 | 108 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
| 112 | + | |
99 | 113 | | |
100 | 114 | | |
101 | 115 | | |
| |||
106 | 120 | | |
107 | 121 | | |
108 | 122 | | |
109 | | - | |
110 | | - | |
| 123 | + | |
| 124 | + | |
111 | 125 | | |
112 | | - | |
113 | | - | |
| 126 | + | |
| 127 | + | |
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
117 | 141 | | |
118 | 142 | | |
119 | 143 | | |
| |||
0 commit comments