{"action":"opened","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2506","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2506/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2506/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2506/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/2506","id":109440274,"number":2506,"title":"setSprite does not handle scales <1.0x or >2.0x","user":{"login":"ljbade","id":1215089,"avatar_url":"https://avatars.githubusercontent.com/u/1215089?v=3","gravatar_id":"","url":"https://api.github.com/users/ljbade","html_url":"https://github.com/ljbade","followers_url":"https://api.github.com/users/ljbade/followers","following_url":"https://api.github.com/users/ljbade/following{/other_user}","gists_url":"https://api.github.com/users/ljbade/gists{/gist_id}","starred_url":"https://api.github.com/users/ljbade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljbade/subscriptions","organizations_url":"https://api.github.com/users/ljbade/orgs","repos_url":"https://api.github.com/users/ljbade/repos","events_url":"https://api.github.com/users/ljbade/events{/privacy}","received_events_url":"https://api.github.com/users/ljbade/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/Android","name":"Android","color":"5319e7"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/iOS","name":"iOS","color":"207de5"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/refactor","name":"refactor","color":"4c4c4c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/11","html_url":"https://github.com/mapbox/mapbox-gl-native/milestones/android-v2.1.0","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/11/labels","id":1252366,"number":11,"title":"android-v2.1.0","description":"","creator":{"login":"bleege","id":989928,"avatar_url":"https://avatars.githubusercontent.com/u/989928?v=3","gravatar_id":"","url":"https://api.github.com/users/bleege","html_url":"https://github.com/bleege","followers_url":"https://api.github.com/users/bleege/followers","following_url":"https://api.github.com/users/bleege/following{/other_user}","gists_url":"https://api.github.com/users/bleege/gists{/gist_id}","starred_url":"https://api.github.com/users/bleege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleege/subscriptions","organizations_url":"https://api.github.com/users/bleege/orgs","repos_url":"https://api.github.com/users/bleege/repos","events_url":"https://api.github.com/users/bleege/events{/privacy}","received_events_url":"https://api.github.com/users/bleege/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":32,"state":"open","created_at":"2015-08-12T19:07:24Z","updated_at":"2015-10-02T07:05:23Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-10-02T07:05:22Z","updated_at":"2015-10-02T07:05:22Z","closed_at":null,"body":"As I discovered while working on #2440 the current core `setSprite` function is not flexible enough for the needs of Android. @friedbunny also noted that 3x needed for new iOS devices is also not supported.\r\n\r\nThe `scale` parameter crashes if you pass it <1.0 or >2.0. Android needs to support at least up to 4.0 (currently - future devices can increase this) and below 1.0.\r\n\r\nA below 1.0 case might be where a developer only includes hdpi bitmaps assets, then a user runs the app on a ldpi or mdpi phone. In this case we need to scale down.\r\n\r\nThere are two ways I can see to fix this:\r\n- scale the Bitmap to the correct 1x or 2x sprite texture size using the CPU - will result in blurry markers on higher DPI devices\r\n- make sprites scale independent by storing them in their native resolution in the texture, then using the vertex shader to scale them on the CPU\r\n\r\n/cc @1ec5 @incanus @kkaefer @nickidlugash @bleege @jfirebaugh "}}