@luceosports/play-rendering 1.11.8 → 1.11.11
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/dist/play-rendering.js +1 -1
- package/dist/play-rendering.js.map +1 -1
- package/package.json +1 -1
- package/src/layers/NoteLayer.js +12 -8
- package/src/models/Frame.js +2 -2
- package/src/models/Note.js +2 -2
package/package.json
CHANGED
package/src/layers/NoteLayer.js
CHANGED
|
@@ -85,7 +85,7 @@ class NoteLayer extends BaseLayer {
|
|
|
85
85
|
this.ctx.beginPath();
|
|
86
86
|
this.ctx.rect(0, 0, width, height);
|
|
87
87
|
this.ctx.fill();
|
|
88
|
-
if (note.showBorder) {
|
|
88
|
+
if (note.showBorder || this.options.noteSelectedId === note.id) {
|
|
89
89
|
this.ctx.stroke();
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -125,16 +125,16 @@ class NoteLayer extends BaseLayer {
|
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
if (note.font.underline || note.font.strikethrough) {
|
|
128
|
-
this.ctx.lineWidth = 0.07;
|
|
128
|
+
this.ctx.lineWidth = 0.07 * note.fontSize;
|
|
129
129
|
this.ctx.strokeStyle = `rgba(0, 0, 0, ${this.noteAlpha})`;
|
|
130
130
|
this.ctx.beginPath();
|
|
131
131
|
if (note.font.underline) {
|
|
132
|
-
this.ctx.moveTo(0, note.
|
|
133
|
-
this.ctx.lineTo(wordStartX, note.
|
|
132
|
+
this.ctx.moveTo(0, note.fontSize - Note.NOTE_LINE_HEIGHT_OFFSET / 2);
|
|
133
|
+
this.ctx.lineTo(wordStartX, note.fontSize - Note.NOTE_LINE_HEIGHT_OFFSET / 2);
|
|
134
134
|
}
|
|
135
135
|
if (note.font.strikethrough) {
|
|
136
|
-
this.ctx.moveTo(0, note.lineHeight / 2 - Note.NOTE_LINE_HEIGHT_OFFSET);
|
|
137
|
-
this.ctx.lineTo(wordStartX, note.lineHeight / 2 - Note.NOTE_LINE_HEIGHT_OFFSET);
|
|
136
|
+
this.ctx.moveTo(0, note.lineHeight / 2 - Note.NOTE_LINE_HEIGHT_OFFSET / 3);
|
|
137
|
+
this.ctx.lineTo(wordStartX, note.lineHeight / 2 - Note.NOTE_LINE_HEIGHT_OFFSET / 3);
|
|
138
138
|
}
|
|
139
139
|
this.ctx.stroke();
|
|
140
140
|
}
|
|
@@ -151,12 +151,16 @@ class NoteLayer extends BaseLayer {
|
|
|
151
151
|
this.ctx.beginPath();
|
|
152
152
|
this.ctx.strokeStyle = `rgba(255, 255, 255, ${this.noteAlpha})`;
|
|
153
153
|
this.ctx.fillStyle = `rgba(243, 111, 33, ${this.noteAlpha})`;
|
|
154
|
-
this.ctx.arc(0, note.
|
|
154
|
+
this.ctx.arc(0, note.playerTokenRadius, note.playerTokenRadius, 0, Math.PI * 2);
|
|
155
155
|
this.ctx.fill();
|
|
156
156
|
this.ctx.stroke();
|
|
157
157
|
|
|
158
|
+
const playerFontSize = note.fontSize * 0.8;
|
|
159
|
+
this.ctx.font = `${playerFontSize}px Arial`;
|
|
160
|
+
const textX = -this.ctx.measureText(label).width / 2;
|
|
161
|
+
const textY = ((note.playerTokenRadius * 2 - playerFontSize) / 2) * (1 + Note.NOTE_LINE_HEIGHT_OFFSET);
|
|
158
162
|
this.ctx.fillStyle = `rgba(255, 255, 255, ${this.noteAlpha})`;
|
|
159
|
-
this.ctx.fillText(label,
|
|
163
|
+
this.ctx.fillText(label, textX, textY);
|
|
160
164
|
|
|
161
165
|
this.ctx.restore();
|
|
162
166
|
}
|
package/src/models/Frame.js
CHANGED
|
@@ -130,10 +130,10 @@ class Frame {
|
|
|
130
130
|
const passLines = this.prevAnimationLines.filter(l => ['PASS', 'HANDOFF'].includes(l.type));
|
|
131
131
|
return this.play.playData.players.map(p => {
|
|
132
132
|
const player = new Player(p);
|
|
133
|
-
if (!player.animations.length) return player;
|
|
134
|
-
|
|
135
133
|
player.setPossession(passLines);
|
|
136
134
|
|
|
135
|
+
if (!player.animations.length) return player;
|
|
136
|
+
|
|
137
137
|
player.animations.forEach(animation => {
|
|
138
138
|
const keyTimesChunks = [];
|
|
139
139
|
animation.keyTimes.forEach((value, index) => {
|
package/src/models/Note.js
CHANGED
|
@@ -7,7 +7,7 @@ class Note extends Model {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
static get NOTE_WRAP_MAX_WIDTH() {
|
|
10
|
-
return
|
|
10
|
+
return 40;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
static get NOTE_WRAP_PADDING() {
|
|
@@ -55,7 +55,7 @@ class Note extends Model {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
get playerTokenRadius() {
|
|
58
|
-
return
|
|
58
|
+
return this.fontSize / 2;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
get fontComputed() {
|