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

对Uint8ClampedArray使用toString方法有问题 #1

Open
miccycn opened this issue Dec 23, 2016 · 3 comments
Open

对Uint8ClampedArray使用toString方法有问题 #1

miccycn opened this issue Dec 23, 2016 · 3 comments

Comments

@miccycn
Copy link

miccycn commented Dec 23, 2016

某些低版本安卓浏览器中,对Uint8ClampedArray使用toString方法有问题
会返回“[Object Uint8ClampedArray]”而不是所期望的(255,255,255,0)

@Dafrok
Copy link
Owner

Dafrok commented Dec 23, 2016

其实只要对比第四位alpha值就行了 我一会上飞机 晚上再提一版本。。。

@miccycn
Copy link
Author

miccycn commented Dec 23, 2016

用我们的几个测试机测了一下,还有几个问题:

  1. 部分系统的emoji是基于系统字体的,所以在这种系统里是可以染色的,而且它是很正经的系统表情,unicode也落在emoji的范围,说不是emoji也有点勉强。
  2. 缩成0.01倍以后,部分情况下有值的像素不一定是(0,0,1,1),因为本身缩放以后这个也不是精确值,有值的像素也可能是它周围的某个像素,比如(0,1,0,2)。而(0,0,1,1)本身没东西。

我的建议是:

  1. 不做染色的比对,而改为匹配unicode范围,不在范围内的直接return false,在范围内的再继续检测,仅检测canvas上有没有东西;
  2. 把canvas大小从11改为22,略微增大处理范围;

@Dafrok
Copy link
Owner

Dafrok commented Sep 26, 2017

时隔多年回来看这个 issue,还是没有找到一个完美的匹配范围……

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

No branches or pull requests

2 participants