|
@@ -1,5 +1,5 @@
|
|
|
import { computed, defineComponent, onMounted, reactive, Transition } from "vue";
|
|
|
-import state, { handleSelection, skipNotePlay } from "/src/state";
|
|
|
+import state, { EnumMusicRenderType, handleSelection, skipNotePlay } from "/src/state";
|
|
|
import styles from "./index.module.less";
|
|
|
import { metronomeData } from "/src/helpers/metronome";
|
|
|
import { evaluatingData } from "../evaluating";
|
|
@@ -49,12 +49,22 @@ const calcNoteData = () => {
|
|
|
|
|
|
if (noteEle) {
|
|
|
const noteBbox = noteEle.getBoundingClientRect?.() || { x: 0, width: 0 };
|
|
|
- noteItem.bbox = {
|
|
|
- left: noteBbox.x - parentLeft - noteBbox.width / 4 + "px",
|
|
|
- top: staveBbox.y - parentTop + "px",
|
|
|
- width: noteBbox.width * 1.5 + "px",
|
|
|
- height: staveBbox.height + "px",
|
|
|
- };
|
|
|
+ if (state.musicRenderType !== EnumMusicRenderType.staff) {
|
|
|
+ noteItem.bbox = {
|
|
|
+ left: noteBbox.x - parentLeft - noteBbox.width / 4 + "px",
|
|
|
+ top: noteBbox.y - parentTop - noteBbox.height + "px",
|
|
|
+ width: noteBbox.width * 1.5 + "px",
|
|
|
+ height: noteBbox.height * 3 + "px",
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ noteItem.bbox = {
|
|
|
+ left: noteBbox.x - parentLeft - noteBbox.width / 4 + "px",
|
|
|
+ top: staveBbox.y - parentTop + "px",
|
|
|
+ width: noteBbox.width * 1.5 + "px",
|
|
|
+ height: staveBbox.height + "px",
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
selectData.notes.push(noteItem);
|
|
|
notesList.push(item.noteId);
|