小程序
小游戏
企业微信
微信支付
扫描小程序码分享
小游戏设置为横屏的时候,
ctx.drawImage(
this.img,
0,
this.width,
this.height,
window.innerWidth, // innerWidth写在这里的时候,手机预览时画布尺寸有问题,开发者工具没问题
window.innerHeight,
window.innerWidth, // innerWidth写在这里的时候,手机预览时画布尺寸没问题,开发者工具有问题
)
5 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你好,这是一个已知问题,我们会尽快进行修复。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
没理解。
该Bug还没有修复,期待中
就是
1.手机设为横屏显示的时候:
{
"deviceOrientation"
:
"landscape"
}
2.通过window.innerWidth获取screenWidth, window.innerHeight获取 screenHeight
3.然后画出一个图片
this
.img,
.width,
.height,
screenWidth,
screenHeight
这种情况下, 在开发者工具中预览是没有问题的,但是在手机上预览,就会出现问题(画布被拉伸?)
如果这是将ctx.drawImage方法中的screenWidth和screenHeight的顺序调转,那手机上显示就没问题了,但是在开发者工具上预览就有问题
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你好,这是一个已知问题,我们会尽快进行修复。
没理解。
该Bug还没有修复,期待中
该Bug还没有修复,期待中
就是
1.手机设为横屏显示的时候:
{
"deviceOrientation"
:
"landscape"
}
2.通过window.innerWidth获取screenWidth, window.innerHeight获取 screenHeight
3.然后画出一个图片
ctx.drawImage(
this
.img,
0,
0,
this
.width,
this
.height,
0,
0,
screenWidth,
screenHeight
)
这种情况下, 在开发者工具中预览是没有问题的,但是在手机上预览,就会出现问题(画布被拉伸?)
如果这是将ctx.drawImage方法中的screenWidth和screenHeight的顺序调转,那手机上显示就没问题了,但是在开发者工具上预览就有问题