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

Bug: Shared context multi-view3D mouse event cascading to every View3D #710

Open
rdoi opened this issue Nov 21, 2014 · 1 comment
Open

Comments

@rdoi
Copy link

rdoi commented Nov 21, 2014

Scenario:
There are 2 (or more) View3D, sharing the same context / stage3dproxy, not overlapping.
I have custom mouse event listeners in each view.
If i click in the latest view, and don't hit any object, the mouse event triggered in the latest view will dispatch the event in all previous views.

This happens because there is an "unrestricted" view3d loop in Mouse3DManager.reThrowEvent():

    private function reThrowEvent(event:MouseEvent):void
    {
        if (!_activeView || (_activeView && !_activeView.shareContext))
            return;

        for (var v:* in _view3Ds) {
            if (v != _activeView && _view3Ds[v] < _view3Ds[_activeView]) // <-- *** HERE ***
                v.dispatchEvent(event);
        }
    }

The dispatch condition should "rethrow" the event only when the event happens within the related view area and only when its visible or in the stage.

Verified in the stable v4.1.6 and master branch.

This bug probably happens with touch events too. Doesn't happen with touches.

@rdoi
Copy link
Author

rdoi commented Nov 21, 2014

BTW, my dirty workaround was adding more checks:

if (v != _activeView && _view3Ds[v] < _view3Ds[_activeView] && View3D(v).visible && View3D(v).stage && View3D(v).hitTestPoint(event.stageX, event.stageY))

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

1 participant