Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: canvas fill style 支持的颜色定义错误 #10

Merged
merged 3 commits into from
Jun 10, 2019

Conversation

mutoe
Copy link

@mutoe mutoe commented Jun 6, 2019

修复3个问题

  1. canvas 填充时允许设置颜色的值为 rgb(200,200,200) 之类的值
ctx.setStrokeStyle('#fff')
ctx.setFillStyle('rgb(179,179,179)')
  1. canvas 填充时允许设置颜色的值为一个渐变 (wx.canvasGradient)
const gradient = ctx.createLinearGradient(0, 50, 0, 210)
gradient.addColorStop(0.5, 'rgba(0,0,0,0)')
gradient.addColorStop(1, 'rgba(0,0,0,0.4)')

ctx.setFillStyle(gradient)
ctx.fillRect(0, 50, canvasWidth, 210)
  1. canvas drawImage() 方法不支持 9 个参数以外的异构 (还支持3/5个参数)

types/wx/lib.wx.api.d.ts Outdated Show resolved Hide resolved
@NewFuture NewFuture merged commit 2f819b2 into MS-DG:master Jun 10, 2019
@mutoe mutoe deleted the fix-canvas-fill-style branch July 6, 2019 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants