Skip to content

在安卓手机:小米 5s,系统 MIUI 9.6 | 稳定版,微信版本 6.6.6,Sprite 设置 borderRadius 属性,界面裁剪错 #9

@520ph

Description

@520ph

我使用网络图片,本地图片。或者 bgcolor 属性设置 Sprite。加上 borderRadius 就会裁剪错。在模拟器上没问题,暂时只在小米5s上遇到了。

21391536726070_ pic
21381536725945_ pic
21371536725943_ pic
21401536727915_ pic
21411536728643_ pic

测试代码

<template>
  <view>
    <canvas class="myCanvas" canvas-id="myCanvas" />
  </view>
</template>
<script>
import wepy from 'wepy';
const spritejs = require('../../utils/sprite-wxapp');
export default class GenerateImage extends wepy.page {
  config = {
    navigationBarTitleText: '一起燃烧卡路里',
    navigationBarBackgroundColor: '#FA4676'
  };
  data = {
    avatarUrl: 'https://wx.qlogo.cn/mmopen/vi_32/ZrA7SPMNXYibCdRlsTH0oYnfkv0fKx2FVxHfO7MsiaUubIHRtCTp0Ej2f98lvcWVh9wUXuaHAyepWCTYb2HIy8Ug/132'
  };
  methods = {};
  async onLoad() {
    let scene = new spritejs.Scene(0);
    let layer = scene.layer('myCanvas');
    let avatarUrl = await wepy.downloadFile({
      url: this.avatarUrl
    });
    // let avatar = new spritejs.Sprite(avatarUrl.tempFilePath);
    let avatar = new spritejs.Sprite();
    avatar.attr({
      anchor: [0],
      pos: [50, 100],
      size: [72, 72],
      bgcolor: 'red',
      borderRadius: 10
    });
    layer.append(avatar);
  }
}
</script>
<style lang="less">
page{
  background: #000;
}
.myCanvas {
  position: fixed;
  left: 0;
  top: 0;
  height: 1242px;
  width: 750px;
}
</style>

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions