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

Text placement is not redone during rotation #3582

Merged
merged 1 commit into from
Nov 9, 2016
Merged

Conversation

lucaswoj
Copy link
Contributor

@lucaswoj lucaswoj commented Nov 9, 2016

#3490 marks SymbolBucket#collisionBoxArray, SymbolBucket#symbolInstancesArray, SymbolBucket#symbolQuadsArray as transferables. These StructArrays need to be persisted in the workerside SymbolBucket for layer use by SymbolBucket#redoPlacement.

This manifested as a bug in which text would render upside down after the map was rotated.

expected

ref mapbox/mapbox-gl-test-suite#163

cc @jfirebaugh @mourner

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • post benchmark scores
  • manually test the debug page

if (transferables) {
this.isTransferred = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add the StructArray#isTransferred property and assert(!this.isTransferred) in order to create a regression test for this bug. When run within mapbox-gl-test-suite, transferred resources do not actually become unavailable.

These assertions should help catch similar bugs in the future. Fail loud 🎺

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my omission. Glad we'll catch that next time with the new assertions.

Why did you rename trim to _trim?

@jfirebaugh
Copy link
Contributor

Previously: #3365. Does the regression test for that issue catch this one too, providing the additional assertions are added?

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Nov 9, 2016

You can never blame yourself for breaking something that wasn't tested. No worries.

I renamed StructArray#trim to StructArray#_trim because it isn't called externally anywhere. It used to be called explicitly by Bucket subclasses. I'm a supporter of making public interfaces as small as possible 😄

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Nov 9, 2016

@jfirebaugh By eyeballing, I think this new regression test would've caught #3365 with or without the new assertions.

@lucaswoj lucaswoj merged commit bf0823a into master Nov 9, 2016
@lucaswoj lucaswoj deleted the redo-placement branch November 9, 2016 23:52
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.

3 participants