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

Quest focus-ring appears shifted. #1810

Closed
Sequynth opened this issue May 2, 2020 · 19 comments
Closed

Quest focus-ring appears shifted. #1810

Sequynth opened this issue May 2, 2020 · 19 comments
Labels
blocked blocked by another issue bug

Comments

@Sequynth
Copy link
Contributor

Sequynth commented May 2, 2020

How to Reproduce
It happens for every quest type. I tried complete reinstall, still appears shifted

Versions affected
v19 (fDroid)
Android 6.0
LG G4 H815

@Sequynth Sequynth added the bug label May 2, 2020
@smichel17
Copy link
Member

It's fixed, just not released yet.

@Sequynth
Copy link
Contributor Author

Sequynth commented May 10, 2020

I got the newest version from fDroid today, but the shift is still present, albeit smaller than before
Capture+_2020-05-10-14-42-32

Versions affected
v19.1 (fDroid)
Android 6.0
LG G4 H815

@westnordost
Copy link
Member

If you rotate the map, does the selection ring "wander" or does it stay at the same position relatively to the pin?

@westnordost westnordost reopened this May 10, 2020
@smichel17
Copy link
Member

Always the same relative position (slightly below, slightly left).

@westnordost
Copy link
Member

What's your device? Specifically, what is the DPI of your device?

@smichel17
Copy link
Member

smichel17 commented May 10, 2020

Device is a Samsung Galaxy S6, specifically the SM-G920A.

xxxhdpi, if that's what you were looking for (edit: this was surprisingly hard to find; I ended up just adding code to find it like this: https://stackoverflow.com/questions/3166501/getting-the-screen-density-programmatically-in-android -- so now it's easy for me to get any other screen info you might want)

@westnordost
Copy link
Member

Ok, then it is likely a problem with tangram-es which apparently treats pixel offsets for elements in layers differently than for markers.

I can reproduce it on a xxxhdpi emulator. On a hdpi device, the circle offsets slightly to the right.

Though, the backlog of bugs I reported in tangram-es is already so full, I kind of don't want to add even more there as long as the others are not fixed. Partly because I will have to research the exact problem myself as well and create a minimal example. Perhaps someone else would like to do that and report the exact problem? Setup would be a map data layer consisting of a single dot at a certain position and a map marker at the same position, then, add a certain same offset for both in the style.

@Sequynth
Copy link
Contributor Author

My density is: 1440 x 2560 pixels, 16:9 ratio (~538 ppi density). I cannot convert that to '*hdpi' units like smichel17.

Same behaviour as he describes, offset is constant under rotation.

Does the tangram issue also explain, why the pin is is not exactly on the steps? Its position also changes under rotation (probably rotating around the point it should be contantly point to)

@westnordost
Copy link
Member

Maybe

@RubenKelevra
Copy link
Contributor

I'm not really a fan of pixel peaking on rendering libraries, but I can confirm a very slightly wrong position of the pins.

It's around 10% of the pin size too far down, and stay too far down on the rotation.

But the ring stays where it should be in my case.

Android 9
18:9 6" display with 1080 x 2160px (401ppi)

Screenshot_20200516-190445~2

Screenshot_20200516-192608__01

Screenshot_20200516-192601

@Helium314
Copy link
Collaborator

I tested this a bit and noticd that when changing "display size" in display settings, the marker moves further away from the dot when "display size" decreases.
size
display size (smallest width): large (320) - normal (360) - small (400) - smaller (??) - smallest (514)
The "smallest width" is something I found in developer settings and is changed by "display size". I don't know what it really means, but it looks like some (non-physical) dpi setting and thus might be relevant.

In the screenshots the (pixel) distance between the center of the dot and the center of the blue circle is constant.
For the marker it is hard to determine a center, but at least the horizontal distance between the (vertical) center line of the marker and the center of the dot is constant.

So to me this looks like the centers of dot, marker and circle have the same distance at all display size settings, while actually they should scale.

@westnordost
Copy link
Member

Thank you for the input! What is the "display width" setting?

@Helium314
Copy link
Collaborator

Display size (I assume you mean this) is found in display and accessibility settings (at least in all versions of Lineage OS I used), and basically changes the size of text and icons. Why it has such a confusing name I don't know.

@westnordost
Copy link
Member

Ok I'd say it simulates a different DPI.

@Helium314
Copy link
Collaborator

Actually, where are quest marker (bottom/tip) and dot supposed to be located?
The dot always seems to be higher than the quest location (especially visible at low zoom levels)
The marker is too high for me and seems to be too low for others, see #1810 (comment)

@westnordost
Copy link
Member

westnordost commented Jul 9, 2020 via email

@Helium314
Copy link
Collaborator

I think it's both.
The sizes of pin, circle and dot scale with "display size"
But the pixel-distance between dot and circle center does not scale with "display size", likely the same applies to distance of dot and pin center (not 100% sure, because location of pin center is not that obvious).
The distances need to scale in order to get correct alignment.

When reading https://developer.android.com/training/multiscreen/screendensities#TaskUseDP it might be that the distances are defined in px, but the sizes are in dp.
(and with this link, the "smallest width" setting also makes sense to me, likely this is screen width in dp)

@westnordost
Copy link
Member

That's good information. I think we collected enough info now to make a reasonable bug report. I think the source may be that actually the offsets given in the style are not adjusted at all for different DPIs.

@westnordost westnordost added the blocked blocked by another issue label Jul 9, 2020
westnordost added a commit that referenced this issue Feb 2, 2021
- fixes workarounded crash (tangrams/tangram-es#2136)
- fixes misplacement of quest ring #1810 (and quest pins)
- fixes workarounded crash on Android API 30 #2336 (tangrams/tangram-es#2215)
westnordost added a commit that referenced this issue Feb 3, 2021
- fixes workarounded crash (tangrams/tangram-es#2136)
- fixes misplacement of quest ring #1810 (and quest pins)
- fixes workarounded crash on Android API 30 #2336 (tangrams/tangram-es#2215)
@westnordost
Copy link
Member

was fixed already in v30

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

No branches or pull requests

5 participants