@luceosports/play-rendering 2.2.7 → 2.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luceosports/play-rendering",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "main": "dist/play-rendering.js",
5
5
  "types": "dist/play-rendering.d.ts",
6
6
  "scripts": {
@@ -2,7 +2,8 @@ import BaseLayer from './base/BaseLayer';
2
2
 
3
3
  export default class LineControlPointLayer extends BaseLayer {
4
4
  apply() {
5
- if (!this.options.linesDisplay) return;
5
+ if (this.options.linesDisplay === 'HIDDEN') return;
6
+ if (this.options.linesDisplay === 'START_HIDDEN' && !this.options.animationGlobalProgress) return;
6
7
 
7
8
  this.ctx.save();
8
9
 
@@ -8,7 +8,8 @@ export default class LineLayer extends BaseLayer {
8
8
  }
9
9
 
10
10
  apply() {
11
- if (!this.options.linesDisplay) return;
11
+ if (this.options.linesDisplay === 'HIDDEN') return;
12
+ if (this.options.linesDisplay === 'START_HIDDEN' && !this.options.animationGlobalProgress) return;
12
13
 
13
14
  this.ctx.save();
14
15
 
@@ -489,9 +489,8 @@ export default class FrameModel {
489
489
  prepareCourtPoint(courtPoint: CourtPoint) {
490
490
  const { mirror } = this.play.options;
491
491
  const { width } = this.play.playData.court.courtRect.size;
492
- const { origin } = this.play.playData.court.courtRect;
493
492
  return {
494
- x: mirror ? width + origin.x - (courtPoint.x - origin.x) : courtPoint.x,
493
+ x: mirror ? width - courtPoint.x : courtPoint.x,
495
494
  y: courtPoint.y
496
495
  };
497
496
  }
@@ -4,7 +4,7 @@ export function useDefaults(options?: Partial<PlayModelOptions>): PlayModelOptio
4
4
  const defaults = {
5
5
  width: 300,
6
6
  lineColor: '#fff', // courtBorderColor
7
- linesDisplay: true,
7
+ linesDisplay: 'VISIBLE' as const,
8
8
  linesDisplayOnMoveOnly: true,
9
9
  linesHiddenIds: [],
10
10
  linesSelectedIds: [],
@@ -63,7 +63,7 @@ export type TeamPlayer = {
63
63
  export type PlayModelOptions = {
64
64
  width: number;
65
65
  lineColor: string;
66
- linesDisplay: boolean;
66
+ linesDisplay: 'VISIBLE' | 'HIDDEN' | 'START_HIDDEN';
67
67
  linesSelectedIds: string[];
68
68
  shapeSelectedId: string | null;
69
69
  noteSelectedId: string | null;