Skip to content

Commit

Permalink
[fix] text outlines are barely visible after upgrade to deck 8.9 (#2353)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Oct 3, 2023
1 parent 9d99f0b commit 357f77a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/constants/src/default-settings.ts
Expand Up @@ -1127,6 +1127,11 @@ export const MAP_CONTROLS = keyMirror({
*/
export const PROJECTED_PIXEL_SIZE_MULTIPLIER = 2 / 3;

/**
* Maximum value for text outline width
*/
export const TEXT_OUTLINE_MULTIPLIER = 5;

export const dataTestIds: Record<string, string> = {
infoIcon: 'info-icon',
warningIcon: 'warning-icon',
Expand Down
5 changes: 3 additions & 2 deletions src/layers/src/base-layer.ts
Expand Up @@ -46,7 +46,8 @@ import {
UNKNOWN_COLOR_KEY,
DEFAULT_HIGHLIGHT_COLOR,
DEFAULT_LAYER_LABEL,
PROJECTED_PIXEL_SIZE_MULTIPLIER
PROJECTED_PIXEL_SIZE_MULTIPLIER,
TEXT_OUTLINE_MULTIPLIER
} from '@kepler.gl/constants';

import {
Expand Down Expand Up @@ -1370,7 +1371,7 @@ class Layer {
getTextAnchor: textLabel[i].anchor,
getAlignmentBaseline: textLabel[i].alignment,
getColor: textLabel[i].color,
outlineWidth: textLabel[i].outlineWidth,
outlineWidth: textLabel[i].outlineWidth * TEXT_OUTLINE_MULTIPLIER,
outlineColor: textLabel[i].outlineColor,
background,
getBackgroundColor: textLabel[i].backgroundColor,
Expand Down

0 comments on commit 357f77a

Please sign in to comment.