|
@@ -7,7 +7,8 @@
|
|
<div class="cursor">
|
|
<div class="cursor">
|
|
<div class="cursor-border">
|
|
<div class="cursor-border">
|
|
<span class="text">{{
|
|
<span class="text">{{
|
|
- store.currentSpecialTag || store.currentScore
|
|
|
|
|
|
+ store.currentSpecialTag ||
|
|
|
|
+ (Object.is(store.currentScore, -0) ? "空" : store.currentScore)
|
|
}}</span>
|
|
}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -36,17 +37,22 @@ const makeScoreTrack = (
|
|
if (!store.currentQuestion || typeof store.currentScore === "undefined")
|
|
if (!store.currentQuestion || typeof store.currentScore === "undefined")
|
|
return;
|
|
return;
|
|
const target = event.target as HTMLImageElement;
|
|
const target = event.target as HTMLImageElement;
|
|
- const track = {} as Track;
|
|
|
|
- track.mainNumber = store.currentQuestion?.mainNumber;
|
|
|
|
- track.subNumber = store.currentQuestion?.subNumber;
|
|
|
|
- track.score = store.currentScore;
|
|
|
|
- track.offsetIndex = item.indexInSliceUrls;
|
|
|
|
- track.offsetX = Math.round(
|
|
|
|
- event.offsetX * (target.naturalWidth / target.width) + item.dx
|
|
|
|
- );
|
|
|
|
- track.offsetY = Math.round(
|
|
|
|
- event.offsetY * (target.naturalHeight / target.height) + item.dy
|
|
|
|
- );
|
|
|
|
|
|
+ const track: Track = {
|
|
|
|
+ mainNumber: store.currentQuestion?.mainNumber,
|
|
|
|
+ subNumber: store.currentQuestion?.subNumber,
|
|
|
|
+ score: store.currentScore,
|
|
|
|
+ unanswered: Object.is(store.currentScore, -0),
|
|
|
|
+ offsetIndex: item.indexInSliceUrls,
|
|
|
|
+ offsetX: Math.round(
|
|
|
|
+ event.offsetX * (target.naturalWidth / target.width) + item.dx
|
|
|
|
+ ),
|
|
|
|
+ offsetY: Math.round(
|
|
|
|
+ event.offsetY * (target.naturalHeight / target.height) + item.dy
|
|
|
|
+ ),
|
|
|
|
+ positionX: -1,
|
|
|
|
+ positionY: -1,
|
|
|
|
+ number: -1,
|
|
|
|
+ };
|
|
track.positionX = (track.offsetX - item.dx) / maxSliceWidth;
|
|
track.positionX = (track.offsetX - item.dx) / maxSliceWidth;
|
|
track.positionY =
|
|
track.positionY =
|
|
(track.offsetY - item.dy + item.accumTopHeight) / theFinalHeight;
|
|
(track.offsetY - item.dy + item.accumTopHeight) / theFinalHeight;
|
|
@@ -134,15 +140,18 @@ const makeSpecialTagTrack = (
|
|
if (!store.currentTask || typeof store.currentSpecialTag === "undefined")
|
|
if (!store.currentTask || typeof store.currentSpecialTag === "undefined")
|
|
return;
|
|
return;
|
|
const target = event.target as HTMLImageElement;
|
|
const target = event.target as HTMLImageElement;
|
|
- const track = {} as SpecialTag;
|
|
|
|
- track.tagName = store.currentSpecialTag;
|
|
|
|
- track.offsetIndex = item.indexInSliceUrls;
|
|
|
|
- track.offsetX = Math.round(
|
|
|
|
- event.offsetX * (target.naturalWidth / target.width) + item.dx
|
|
|
|
- );
|
|
|
|
- track.offsetY = Math.round(
|
|
|
|
- event.offsetY * (target.naturalHeight / target.height) + item.dy
|
|
|
|
- );
|
|
|
|
|
|
+ const track: SpecialTag = {
|
|
|
|
+ tagName: store.currentSpecialTag,
|
|
|
|
+ offsetIndex: item.indexInSliceUrls,
|
|
|
|
+ offsetX: Math.round(
|
|
|
|
+ event.offsetX * (target.naturalWidth / target.width) + item.dx
|
|
|
|
+ ),
|
|
|
|
+ offsetY: Math.round(
|
|
|
|
+ event.offsetY * (target.naturalHeight / target.height) + item.dy
|
|
|
|
+ ),
|
|
|
|
+ positionX: -1,
|
|
|
|
+ positionY: -1,
|
|
|
|
+ };
|
|
track.positionX = (track.offsetX - item.dx) / maxSliceWidth;
|
|
track.positionX = (track.offsetX - item.dx) / maxSliceWidth;
|
|
track.positionY =
|
|
track.positionY =
|
|
(track.offsetY - item.dy + item.accumTopHeight) / theFinalHeight;
|
|
(track.offsetY - item.dy + item.accumTopHeight) / theFinalHeight;
|