Explorar el Código

云教练 添加的时候 默认按 画布大小

黄琪勇 hace 4 meses
padre
commit
6b47e7040f

+ 5 - 5
src/hooks/useCreateElement.ts

@@ -320,15 +320,15 @@ export default () => {
    * 创建云教练元素
    * @param url 云教练地址
    */
-  const createCloudCoachElement = (url: string, width = 500, height = 300) => {
+  const createCloudCoachElement = (url: string) => {
     createElement({
       type: "cloudCoach",
       id: nanoid(10),
-      width,
-      height,
+      width: viewportSize.value,
+      height: viewportSize.value * viewportRatio.value,
       rotate: 0,
-      left: (viewportSize.value - 500) / 2,
-      top: (viewportSize.value * viewportRatio.value - 300) / 2,
+      left: 0,
+      top: 0,
       url,
       isMove: false
     })

+ 1 - 0
src/views/components/element/cloudCoachElement/cloudCoachPlayer/cloudCoachPlayer.vue

@@ -45,6 +45,7 @@ function handleIframeLoad() {
   user-select: none;
   line-height: 1;
   transform-origin: 0 0;
+  background-color: #213793;
   .musicIframe {
     width: 100%;
     height: 100%;