Skip to content

Commit 97220f2

Browse files
committed
investigate cut off blocks
1 parent e783d03 commit 97220f2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/ActivityCalendar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ export const ActivityCalendar = forwardRef<HTMLElement, Props>(
251251

252252
function getDimensions() {
253253
return {
254-
width: weeks.length * (blockSize + blockMargin) - blockMargin,
255-
height: labelHeight + (blockSize + blockMargin) * 7 - blockMargin,
254+
width: weeks.length * (blockSize + blockMargin) - blockMargin + 1, // Add 1px because block outlines are cut off otherwise
255+
height: labelHeight + (blockSize + blockMargin) * 7 - blockMargin + 1, // Dito.
256256
}
257257
}
258258

src/styles/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const styles = {
1717
overflowX: 'auto',
1818
overflowY: 'hidden',
1919
paddingTop: Math.ceil(0.1 * fontSize), // SVG <text> overflows in Firefox at y=0
20+
paddingLeft: 1, // Block outlines on the left are cut off otherwise
2021
}) satisfies CSSProperties,
2122
calendar: {
2223
display: 'block', // SVGs are inline-block by default

0 commit comments

Comments
 (0)