bluecadet/Cinder-BluecadetViews

TouchView : canAcceptTouch/isTouchEnabled question

kevinzak opened this issue · 4 comments

Super minor (I think), but is there a reason can accept touch doesn't just also check isTouchEnabled?

    bool TouchView::canAcceptTouch() const {
        return mMultiTouchEnabled || mObjectTouchIDs.empty();
    }

It seems the only place that isTouchEnabled() and canAcceptTouch() is used in the blocks are in this:

if (obj && (!obj->isTouchEnabled() || !obj->canAcceptTouch())) {
        // Don't check for touches in this view or in children if untouchable
        return nullptr;
    }

It seems like canAcceptTouch should also take into account if the touch is enabled.

Scenario:
I disable touch on a view, but enable multi touch. I don't think setting multi touch enabled also enables mTouchEnabled. Therefore, if I call canAcceptTouch() on a view, it would return true, though touch is technically disabled.

Really good points, @kevinzak. This is mostly a relic from NASM and we need to revise this. Perhaps there's an opportunity to fix this and remove canAcceptTouch() altogether since it's so opaque from the outside. We may be able to resolve this in https://github.com/bluecadet/Cinder-BluecadetTouch/pull/18 w @peterchappy's help.

Closing this for now because the check for touches fails if either isTouchEnabled() or canAcceptTouch() returns false.

👋 Miss you guys

@peterchappy ohai! miss you too buddy 🤗