diff --git a/typescript/packages/subsurface-viewer/src/layers/wells/layers/wellLabelLayer.ts b/typescript/packages/subsurface-viewer/src/layers/wells/layers/wellLabelLayer.ts index 13efd5bfd..ddaa11e0b 100644 --- a/typescript/packages/subsurface-viewer/src/layers/wells/layers/wellLabelLayer.ts +++ b/typescript/packages/subsurface-viewer/src/layers/wells/layers/wellLabelLayer.ts @@ -71,28 +71,29 @@ const DEFAULT_PROPS: DefaultProps = { transitions: { // Animate label position transitions in order to help tracking when labels are moving getPosition: { - duration: 1, - type: "spring", - damping: 1, - stiffness: 0.5, + duration: 100, + type: "interpolation", }, // Prevent changed label texts from appearing before the label background // has moved into place getColor: { - duration: 50, + duration: 100, type: "interpolation", enter: ([r, g, b]: Color) => [r, g, b, 0], easing: (t: number) => _.floor(t), }, - // Cosmetic effects for fading in the label background - getBackgroundColor: { + // Prevent changed background border from appearing before the label text + getBorderColor: { duration: 1, - type: "spring", + type: "interpolation", enter: ([r, g, b]: Color) => [r, g, b, 0], + easing: (t: number) => _.floor(t), }, - getBorderColor: { + + // Cosmetic effects for fading in the label background + getBackgroundColor: { duration: 1, type: "spring", enter: ([r, g, b]: Color) => [r, g, b, 0], @@ -246,8 +247,7 @@ export class WellLabelLayer extends MergedTextLayer< return [0, [0, 0, 0]]; } - const width = this.context.viewport.width; - const height = this.context.viewport.height; + const { width, height } = this.context.viewport; const candidateFractions = [0.5, 0.25, 0.75, 0.125, 0.87, 0.37, 0.62]; diff --git a/typescript/packages/subsurface-viewer/src/storybook/layers/__image_snapshots__/subsurfaceviewer-well-label-layer--label-auto-position.png b/typescript/packages/subsurface-viewer/src/storybook/layers/__image_snapshots__/subsurfaceviewer-well-label-layer--label-auto-position.png index 15af469d2..db3a9f2ed 100644 Binary files a/typescript/packages/subsurface-viewer/src/storybook/layers/__image_snapshots__/subsurfaceviewer-well-label-layer--label-auto-position.png and b/typescript/packages/subsurface-viewer/src/storybook/layers/__image_snapshots__/subsurfaceviewer-well-label-layer--label-auto-position.png differ