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

canvas添加渐变色报错 #371

Closed
zhe-he opened this issue May 7, 2019 · 2 comments
Closed

canvas添加渐变色报错 #371

zhe-he opened this issue May 7, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@zhe-he
Copy link

zhe-he commented May 7, 2019

问题描述
在ctx.setStrokeStyle(gradient1); 此处报错,Uncaught (in promise) TypeError: t.toLowerCase is not a function。
改为 ctx.setStrokeStyle('rgba(255,255,255,0.3)')不报错
复现步骤

 var gradient1 = ctx.createCircularGradient(50, 50, 100);
 gradient1.addColorStop(0, 'red');
 gradient1.addColorStop(1, 'yellow');
 ctx.setStrokeStyle(gradient1);
 ctx.setLineWidth(2);
 ctx.stroke();
 ctx.closePath();```


**预期结果**
设置一个渐变的线条
**实际结果**
setStrokeStyle报错->Uncaught (in promise) TypeError: t.toLowerCase is not a function。
@dcloudhdx dcloudhdx added the bug Something isn't working label May 7, 2019
@dcloudhdx
Copy link
Contributor

bug已确认,仅在H5平台有问题,下版修复

@hbcui1984
Copy link
Contributor

HBuilderX 1.9.6 Alpha 版发布,已修复该问题。

Alpha版本说明及下载地址参考:https://ask.dcloud.net.cn/article/35765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants