Skip to content

Commit b3fed6d

Browse files
refactor: supporter row centering and SVG dimension extraction (#50)
1 parent 439a439 commit b3fed6d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

configs/sponsors/contribkit.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ export default defineConfig({
176176
compose.addSpan(30);
177177

178178
const padding = 20; // Padding between supporters
179-
let currentX = padding;
180179
const supporters = [...specialSupporters];
181180

182181
while (supporters.length) {
@@ -199,8 +198,7 @@ export default defineConfig({
199198
}
200199

201200
// Center row horizontally
202-
const startX = (config.width! - rowWidth + padding) / 2;
203-
currentX = startX;
201+
let currentX = (config.width! - rowWidth + padding) / 2;
204202

205203
// Add supporters in row
206204
for (const supporter of row) {

configs/sponsors/svg-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function extractSvgDimensions(svgContent: string): { width: number; heigh
1111
// Try to get dimensions from viewBox first
1212
const viewBoxMatch = svgContent.match(/viewBox=['"]([^'"]*)['"]/);
1313
if (viewBoxMatch) {
14-
const [minX, minY, width, height] = viewBoxMatch[1].split(/\s+/).map(Number);
14+
const [, , width, height] = viewBoxMatch[1].split(/\s+/).map(Number);
1515
// Check that both width and height are valid numbers (not NaN and not undefined)
1616
if (!Number.isNaN(width) && !Number.isNaN(height) && width !== undefined && height !== undefined) {
1717
return { width, height };

0 commit comments

Comments
 (0)