From 74d2fc6406c930df2f5823de0318346c10a8c7a5 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Mon, 12 Jun 2023 17:43:31 +0200 Subject: [PATCH] fix: collab username style fixes (#6668) --- src/renderer/renderScene.ts | 9 ++------- src/renderer/roundRect.ts | 4 ++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/renderer/renderScene.ts b/src/renderer/renderScene.ts index 53c4f387..07c5649c 100644 --- a/src/renderer/renderScene.ts +++ b/src/renderer/renderScene.ts @@ -743,12 +743,7 @@ export const _renderScene = ({ context.strokeStyle = oc.white; context.stroke(); } else { - // Border - context.fillStyle = oc.white; - context.fillRect(boxX, boxY, boxWidth, boxHeight); - // Background - context.fillStyle = background; - context.fillRect(offsetX, offsetY, boxWidth - 2, boxHeight - 2); + roundRect(context, boxX, boxY, boxWidth, boxHeight, 8, oc.white); } context.fillStyle = oc.black; @@ -759,7 +754,7 @@ export const _renderScene = ({ paddingVertical + measure.actualBoundingBoxAscent + Math.floor((finalHeight - measureHeight) / 2) + - 1, + 2, ); } diff --git a/src/renderer/roundRect.ts b/src/renderer/roundRect.ts index be842a52..bbb98306 100644 --- a/src/renderer/roundRect.ts +++ b/src/renderer/roundRect.ts @@ -15,6 +15,7 @@ export const roundRect = ( width: number, height: number, radius: number, + strokeColor?: string, ) => { context.beginPath(); context.moveTo(x + radius, y); @@ -33,5 +34,8 @@ export const roundRect = ( context.quadraticCurveTo(x, y, x + radius, y); context.closePath(); context.fill(); + if (strokeColor) { + context.strokeStyle = strokeColor; + } context.stroke(); };