Skip to content

Conversation

@matteblair
Copy link
Member

Resolves #1167

This solves the observed problem, but I'm not sure that this is the intended data flow :\

@karimnaaji
Copy link
Member

karimnaaji commented Dec 15, 2016

This actually breaks the unique selection color that each label would be given. After some debugging I think I found where the issue lives.

Several things that makes this bug appear:

        std::vector<Tangram::SceneUpdate> updates = {
            {"layers.mz_current_location_gem.draw.ux-location-gem-overlay.interactive", "true"},
        };
        map->loadSceneAsync("https://raw.githubusercontent.com/tangrams/bubble-wrap/gh-pages/bubble-wrap.yaml",
            true, nullptr, nullptr, updates);

cc @ecgreb on that to confirm the value of the interactive flag.

  • Some recent optimization uses the set m_labels within labels.cpp to retrieve the label associated to a specific selection color read from the framebuffer. The bug is that this set is only added labels that can not occlude, which is true from the stylesheet here.

I guess we would need to have a separate vector in labels.cpp that contains all labels (including the ones that can't occlude) to be able to retrieve the matching selectionColor -> label.

@karimnaaji
Copy link
Member

karimnaaji commented Dec 15, 2016

@blair1618 pushed a hot fix on this branch https://github.com/tangrams/tangram-es/tree/hot-fix-1167.

@hjanetzek
Copy link
Member

@karimnaaji ah right! missing these interactive labels. We could add only the labels with selection color to m_selectionLabels instead of collecting all.

@karimnaaji
Copy link
Member

@hjanetzek , right maintaining that set from labels.cpp would be the right way to handle that!

@matteblair
Copy link
Member Author

Ah good catch, I forgot that each label needs it's own selection identifier and it can't just use the same one as the feature. I'll test that fix you pushed.

@tallytalwar
Copy link
Member

tallytalwar commented Dec 15, 2016

@karimnaaji I see what you are mentioning.

  1. Current location gem should be marked non interactive in the style sheet. It might be for the purposes of the example, @ecgreb could have referenced it. But yes I see the point of the bug :D.

  2. I see the bug of non colliding labels are not checked when retrieving the labels for selection color. Instead of putting all visible labels for selection color checking, does it make sense to only put labels with "interactive" property set for selection color checking? Say if only pois are marked interactive, it will be wasteful to check for all text labels for selection colors. Moving this comment to Hot fix for https://github.com/tangrams/tangram-es/issues/1167 #1185

@ecgreb
Copy link
Contributor

ecgreb commented Dec 16, 2016

In the version of the stylesheet I was using at the time current location gem was marked interactive. However after this commit was merged that is now no longer the case.

But yes I did verify the layer was interactive when reproducing the issue. And I agree the current location gem should NOT be interactive moving forward I was just using it for the test case.

@matteblair
Copy link
Member Author

Yes, bubble-wrap was very recently revised to reduce the interactive layers.

Closing in favor of #1185

@matteblair matteblair closed this Dec 16, 2016
@nvkelso
Copy link
Member

nvkelso commented Dec 16, 2016 via email

@tallytalwar tallytalwar deleted the fix-label-selection branch December 17, 2016 03:04
@tallytalwar tallytalwar restored the fix-label-selection branch December 17, 2016 03:04
@tallytalwar tallytalwar deleted the fix-label-selection branch December 17, 2016 03:05
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

Successfully merging this pull request may close these issues.

7 participants