Commit 436e1352 authored by 毛线's avatar 毛线

去掉无用代码

parent ec13bfcc
...@@ -115,24 +115,6 @@ export default { ...@@ -115,24 +115,6 @@ export default {
card.draw(ctx) card.draw(ctx)
}) })
} }
// const card = new Card({
// x: 10,
// y: 10,
// width: 150,
// height: 150,
// bgImg: 'https://shengdi-image.oss-cn-shenzhen.aliyuncs.com/2023/05/30/tmp_b457b0ef3788dec5abcc5626ed03fe47',
// })
// card.draw(ctx)
// const card2 = new Card({
// x: 400,
// y: 100,
// width: 400,
// height: 400,
// bgImg: 'https://img2.baidu.com/it/u=2207107653,2475297256&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281',
// })
// card2.draw(ctx)
}, },
// 初始化数据 // 初始化数据
initData(value) { initData(value) {
...@@ -187,11 +169,6 @@ function Card(params) { ...@@ -187,11 +169,6 @@ function Card(params) {
// 计算矩形的中心 // 计算矩形的中心
const centerX = x + width / 2 const centerX = x + width / 2
const centerY = y + height / 2 const centerY = y + height / 2
// console.log('centerX', centerX)
// console.log('centerY', centerY)
// ctx.save() // 保存当前状态
// ctx.rotate(Math.PI * (deg / 180))
// ctx.rotate(-Math.PI * (deg / 180))
ctx.translate(centerX, centerY) ctx.translate(centerX, centerY)
ctx.rotate(Math.PI * (deg / 180)) ctx.rotate(Math.PI * (deg / 180))
ctx.translate(-centerX, -centerY) ctx.translate(-centerX, -centerY)
...@@ -199,12 +176,6 @@ function Card(params) { ...@@ -199,12 +176,6 @@ function Card(params) {
ctx.translate(centerX, centerY) ctx.translate(centerX, centerY)
ctx.rotate(Math.PI * (-deg / 180)) ctx.rotate(Math.PI * (-deg / 180))
ctx.translate(-centerX, -centerY) ctx.translate(-centerX, -centerY)
// ctx.translate(-centerX, -centerY)
// ctx.rotate(Math.PI / 4)
// // ctx.translate(centerX, centerY)
// ctx.drawImage(img, 0, 0, img.width, img.height, x, y, width, height)
// ctx.translate(centerX, centerY)
// ctx.restore()
console.log('渲染图片') console.log('渲染图片')
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment