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

部分机型点击弹幕没有回调 #473

Open
ggy-yao opened this issue Mar 30, 2023 · 1 comment
Open

部分机型点击弹幕没有回调 #473

ggy-yao opened this issue Mar 30, 2023 · 1 comment

Comments

@ggy-yao
Copy link

ggy-yao commented Mar 30, 2023

仅仅用到弹幕一个功能,没有播放器.
同样的代码在不同的手机中点击弹幕效果不同.
部分手机在点击弹幕时无效,有些手机有效.我跟踪了一下点击事件,发现点击事件无效的时候源码中以下判断是不成立的.只有在前几条弹幕点击有效.前几条弹幕走完之后,后面全都无效,,这是为什么
private IDanmakus touchHitDanmaku(final float x, final float y) {
final IDanmakus hitDanmakus = new Danmakus();
mDanmakuBounds.setEmpty();

    IDanmakus danmakus = danmakuView.getCurrentVisibleDanmakus();
    if (null != danmakus && !danmakus.isEmpty()) {
        danmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
            @Override
            public int accept(BaseDanmaku danmaku) {
                if (null != danmaku) {
                    mDanmakuBounds.set(danmaku.getLeft(), danmaku.getTop(), danmaku.getRight(), danmaku.getBottom());
                   这里判断不成立,
                    if (mDanmakuBounds.intersect(x - mXOff, y - mYOff, x + mXOff, y + mYOff)) {
                        hitDanmakus.addItem(danmaku);
                    }
                }
                return ACTION_CONTINUE;
            }
        });
    }

    return hitDanmakus;
}
@ggy-yao ggy-yao changed the title 点击弹幕没有回调 部分机型点击弹幕没有回调 Mar 30, 2023
@fumayer
Copy link

fumayer commented Jun 30, 2023

请问您有解决吗

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