Elffuss BraidHub

kikocis/continue public

use radius instead of 10
Changeseta68de206588285c0ed59f80bf34b7434b1b45d2cf6c4331115e19ced3f0e59bd
AuthorJacob Kim <jacob@continue.dev> · 2025-07-04 19:48 -07:00
CommitterJacob Kim <jacob@continue.dev> · 2025-07-04 19:48 -07:00
Parents0ee2a996bcff

Browse the files at this changeset

1 file changed

modified core/codeRenderer/CodeRenderer.ts +9 −10
@@ -291,31 +291,30 @@
291291 const y = index * lineHeight;
292292 const isFirst = index === 0;
293293 const isLast = index === lines.length - 1;
294- const topRadius = isFirst ? "10" : "0";
295- const bottomRadius = isLast ? "10" : "0";
294+ const radius = 10;
296295 // SVG notes:
297296 // By default SVGs have anti-aliasing on.
298297 // This is undesirable in our case because pixel-perfect alignment of these rectangles will introduce thin gaps.
299298 // Turning it off with 'shape-rendering="crispEdges"' solves the issue.
300299 return isFirst
301300 ? `<path d="M ${0} ${y + lineHeight}
302- L ${0} ${y + 10}
303- Q ${0} ${y} ${10} ${y}
304- L ${dimensions.width - 10} ${y}
305- Q ${dimensions.width} ${y} ${dimensions.width} ${y + 10}
301+ L ${0} ${y + radius}
302+ Q ${0} ${y} ${radius} ${y}
303+ L ${dimensions.width - radius} ${y}
304+ Q ${dimensions.width} ${y} ${dimensions.width} ${y + radius}
306305 L ${dimensions.width} ${y + lineHeight}
307306 Z"
308307 fill="${bgColor}" />`
309308 : isLast
310309 ? `<path d="M ${0} ${y}
311- L ${0} ${y + lineHeight - 10}
312- Q ${0} ${y + lineHeight} ${10} ${y + lineHeight}
313- L ${dimensions.width - 10} ${y + lineHeight}
310+ L ${0} ${y + lineHeight - radius}
311+ Q ${0} ${y + lineHeight} ${radius} ${y + lineHeight}
312+ L ${dimensions.width - radius} ${y + lineHeight}
314313 Q ${dimensions.width} ${y + lineHeight} ${dimensions.width} ${y + lineHeight - 10}
315314 L ${dimensions.width} ${y}
316315 Z"
317316 fill="${bgColor}" />`
318- : `<rect x="0" y="${y}" rx="10" ry="10" width="100%" height="${lineHeight}" fill="${bgColor}" shape-rendering="crispEdges" />`;
317+ : `<rect x="0" y="${y}" rx="${radius}" ry="${radius}" width="100%" height="${lineHeight}" fill="${bgColor}" shape-rendering="crispEdges" />`;
319318 })
320319 .join("\n");
321320