提交 02ba4efa 编写于 作者: H hdx

canvas: 调整默认大小

上级 f80c80d2
<template> <template>
<view> <view>
<page-head :title="title"></page-head>
<view class="page-body"> <view class="page-body">
<!-- #ifdef APP-PLUS || H5 --> <!-- #ifdef APP-PLUS || H5 -->
<canvas canvas-id="canvas" class="canvas" :start="startStatus" :change:start="animate.start" <canvas canvas-id="canvas" class="canvas" :start="startStatus" :change:start="animate.start"
...@@ -91,17 +92,8 @@ ...@@ -91,17 +92,8 @@
x = radius * cos + canvasWidth / 2, x = radius * cos + canvasWidth / 2,
y = radius * sin + canvasHeight / 2, y = radius * sin + canvasHeight / 2,
vx = speed * cos, vx = speed * cos,
vy = speed * sin vy = speed * sin;
ballList.push(new Ball({ ballList.push(new Ball({x, y, vx, vy, canvasWidth, canvasHeight, ctx, radius: 5}))
x,
y,
vx,
vy,
canvasWidth,
canvasHeight,
ctx,
radius: 5
}))
} }
} }
...@@ -247,13 +239,11 @@ ...@@ -247,13 +239,11 @@
</script> </script>
<style> <style>
.page-body-wrapper {
text-align: center;
}
.canvas { .canvas {
width: 1024px; width: 610rpx;
min-height: 1024px; height: 610rpx;
background-color: #fff; background-color: #fff;
margin-left: auto;
margin-right: auto;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册