@luceosports/play-rendering 2.2.5 → 2.2.7

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.5",
3
+ "version": "2.2.7",
4
4
  "main": "dist/play-rendering.js",
5
5
  "types": "dist/play-rendering.d.ts",
6
6
  "scripts": {
@@ -8,6 +8,8 @@ export default class NoteLayer extends BaseLayer {
8
8
  apply() {
9
9
  this.ctx.save();
10
10
 
11
+ this.disableMirrorMode();
12
+
11
13
  this.playData.notes.forEach(note => {
12
14
  this.ctx.save();
13
15
 
@@ -147,7 +147,7 @@ export default class PlayerLayer extends BaseLayer {
147
147
  }
148
148
 
149
149
  let playerTextLabel = player.textLabel;
150
- if (playerMapItem) {
150
+ if (playerMapItem && this.options.labelsOverrideType) {
151
151
  if (playerMapItem.textOverride) {
152
152
  playerTextLabel = playerMapItem.textOverride;
153
153
  }
@@ -12,4 +12,10 @@ export default class BaseLayer {
12
12
  ...courtTypeConstants[this.playData.court.type]
13
13
  };
14
14
  }
15
+
16
+ disableMirrorMode() {
17
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0);
18
+ this.ctx.scale(this.options.scale, this.options.scale);
19
+ this.ctx.translate(-this.playData.court.courtRect.origin.x, -this.playData.court.courtRect.origin.y);
20
+ }
15
21
  }