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 translate is throwing an error #2762

Closed
mcwhittemore opened this issue Jun 17, 2016 · 6 comments
Closed

Text translate is throwing an error #2762

mcwhittemore opened this issue Jun 17, 2016 · 6 comments
Labels

Comments

@mcwhittemore
Copy link
Contributor

mcwhittemore commented Jun 17, 2016

mapbox-gl-js version: 0.20.0

Steps to Trigger Behavior

  1. updating text-translate value throws an error

Expected Behavior

The text should move

Actual Behavior

image

@mcwhittemore mcwhittemore changed the title Text Translate is throwing an error Text translate is throwing an error Jun 17, 2016
@samanpwbb
Copy link
Contributor

samanpwbb commented Jun 20, 2016

This is breaking Mapbox Studio in production right now. If user attempts to change text-translate, the map crashes.

jfirebaugh added a commit to mapbox/mapbox-gl-test-suite that referenced this issue Jun 20, 2016
@jfirebaugh
Copy link
Contributor

I'm unable to reproduce the issue. I added this test case to the test suite and it passes as expected.

Can you provide more detail about how to reproduce this?

@jfirebaugh
Copy link
Contributor

Never mind, I can reproduce it if I set an explicit starting value for text-translate.

jfirebaugh added a commit to mapbox/mapbox-gl-test-suite that referenced this issue Jun 20, 2016
jfirebaugh added a commit to mapbox/mapbox-gl-test-suite that referenced this issue Jun 20, 2016
@jfirebaugh
Copy link
Contributor

This seems to be related to #2561, the fix for #2534.

@jfirebaugh
Copy link
Contributor

This is a latent bug in transition calculation that existed prior to #2561. Prior to #2561, a transition between "text-translate": [a, b] and "text-translate": [c, d]:

  1. Started with [a, b]
  2. Jumped to a value of [0, 0] when the transition began
  3. Stayed at [0, 0] for the duration of the transition
  4. Jumped to [c, d] at the conclusion of the transition

After #2561, it causes a runtime exception instead. Both behaviors are incorrect; the intended behavior is a smooth transition between the old and new translate values.

The bug arises due to an incorrect condition on when to apply the transition calculations intended for "cross-fading" properties. {background,fill,line}-pattern and line-dasharray are the only properties that are intended to have this type of transition calculation. This condition correctly selects only those properties, but this one incorrectly includes any array-typed property.

(Strict typing would have caught this bug.)

@mcwhittemore
Copy link
Contributor Author

@jfirebaugh sorry for missing your comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants