Forráskód Böngészése

Merge branch 'feature-tianyong' into klx-test

TIANYONG 3 hete
szülő
commit
4702051bc6
1 módosított fájl, 9 hozzáadás és 2 törlés
  1. 9 2
      src/view/selection/index.tsx

+ 9 - 2
src/view/selection/index.tsx

@@ -92,11 +92,18 @@ export default defineComponent({
 								}
 								
 							} else {
+								// 判断是否是滑音,滑音的宽度很大,会覆盖掉前面的音符区域,导致无法点击选中前一个音符,需要缩小滑音的点击区域
+								let vibratoReduceX = 0;
+								if (noteEle?.querySelector('.vf-vibrato')) {
+									vibratoReduceX = 50;
+								} else {
+									vibratoReduceX = 0;
+								}								
 								const needTransY = -(staveBbox.height - customBgBox.height) / 2 + "px";
 								noteItem.bbox = {
-									left: noteBbox.x - parentLeft - noteBbox.width / 4 + "px",
+									left: noteBbox.x - parentLeft - noteBbox.width / 4 + vibratoReduceX + "px",
 									top: customBgBox.y ? customBgBox.y - parentTop + "px" : staveBbox.y - parentTop + "px",
-									width: noteBbox.width * 1.5 + "px",
+									width: noteBbox.width * 1.5 - vibratoReduceX + "px",
 									height: staveBbox.height + "px",
 									x: item.bbox?.x,
 									y: item.bbox?.y,