Skip to content

Text placement is not redone during rotation - #3582

Merged
lucaswoj merged 1 commit into
masterfrom
redo-placement
Nov 9, 2016
Merged

lucaswoj merged 1 commit into
masterfrom
redo-placement

Conversation

@lucaswoj

@lucaswoj lucaswoj commented Nov 9, 2016 •

Copy link
Copy Markdown
Contributor

#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

Comment thread js/util/struct_array.js
this._trim();

if (transferables) {
this.isTransferred = true;

Copy link
Copy Markdown
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 🎺

@mourner mourner left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

@lucaswoj

lucaswoj commented Nov 9, 2016 •

Copy link
Copy Markdown
Contributor Author

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

lucaswoj commented Nov 9, 2016

Copy link
Copy Markdown
Contributor Author

@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