From 31f76d59a25ae0daded9c57d5088f382e92ef7ca Mon Sep 17 00:00:00 2001 From: Lipis Date: Sat, 4 Apr 2020 00:54:04 +0300 Subject: [PATCH] Skip transparent background for cursor (#1208) * Skip transparent background for cursor * slice --- src/renderer/renderScene.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/renderer/renderScene.ts b/src/renderer/renderScene.ts index 6bbb21b5..9f794faf 100644 --- a/src/renderer/renderScene.ts +++ b/src/renderer/renderScene.ts @@ -22,9 +22,13 @@ type HandlerRectanglesRet = keyof ReturnType; function colorsForClientId(clientId: string) { // Naive way of getting an integer out of the clientId const sum = clientId.split("").reduce((a, str) => a + str.charCodeAt(0), 0); + + // Skip transparent background. + const backgrounds = colors.elementBackground.slice(1); + const strokes = colors.elementStroke.slice(1); return { - background: colors.elementBackground[sum % colors.elementBackground.length], - stroke: colors.elementStroke[sum % colors.elementBackground.length], + background: backgrounds[sum % backgrounds.length], + stroke: strokes[sum % strokes.length], }; }