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

旋律线不超出铺面

黄琪勇 9 hónapja
szülő
commit
19ac5e484c

+ 2 - 2
src/page-instrument/view-detail/smoothAnimation/index.ts

@@ -443,8 +443,8 @@ function getPointsPosByBatePos(): pointsPosType {
    }
    }
    extendPoint.MeasureNumberXML += 100 // 防止MeasureNumberXML重复
    extendPoint.MeasureNumberXML += 100 // 防止MeasureNumberXML重复
    extendPoint.noteId += 100 // 防止noteId重复
    extendPoint.noteId += 100 // 防止noteId重复
-   // 当总长度减30小于最后一个音符时候,取最后一个音符加15
-   extendPoint.x = smoothAnimationState.canvasDomWith - 30 > extendPoint.x ? smoothAnimationState.canvasDomWith - 30 : extendPoint.x + 15
+   // 当总长度减10 和 最后一个音符加 10 取最大值 34是一倍的边距
+   extendPoint.x = Math.max(smoothAnimationState.canvasDomWith - 34 * state.zoom - 10, extendPoint.x + 10)
    pointsPos.push(extendPoint)
    pointsPos.push(extendPoint)
    return pointsPos
    return pointsPos
 }
 }