Closed Bug 775759 Opened 12 years ago Closed 12 years ago

Native handles don't precisely line up horizontally with the ends of the selection

Categories

(Firefox for Android Graveyard :: Text Selection, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox15 verified, firefox16 verified, firefox17 verified)

VERIFIED FIXED
Firefox 17
Tracking Status
firefox15 --- verified
firefox16 --- verified
firefox17 --- verified

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file)

There's probably some style issue we need to fix in Java. It looks like the image itself may have some transparent space on the edge.
One of the issues here is that the images have shadows on their taller sides, and the edge of the shadow is lining up with the edge of the selection. I tried adding an offset to the margin to account for this, but it can still be off by varying amounts at times, and I'm wondering if there's some issue with our coordinate conversions. I'm testing right now with the patch for bug 775722 applied.
This doesn't fix the issue I was seeing with the more random mispositioning of the handles, but it does help generally get them closer to the right spot.

I picked 2dp kind of randomly because it seemed to work. Ian, is there a more correct way to be choosing this value? (Density-independent pixels always confuse me.)
Assignee: nobody → margaret.leibovic
Attachment #644523 - Flags: review?(mbrubeck)
Well, whatever number is the one that fixes it really ;)

--

But in terms of understanding DIPs, a (somewhat) simple way of looking at it is:

On MDPI screens, 2 DIP = 2 actual pixels
For HDPI screens, 2 DIP = 3 actual pixels
For XHDPI screens, 2 DIP = 4 actual pixels

Or in other words, the relative density of MDPI / HDPI / XHDPI is 1x / 1.5x / 2x

This way if you know what kind of phone you have, you can look at a screenshot and work out, based on actual pixels, how many DIPs you need to adjust something to make it work. 

Hopefully that's helpful and not more confusing. FWIW I can barely keep up even on good days ;)
Cool, well I think 2dp is right then, since the MDPI image we use has 2px of shadow.
Attachment #644523 - Flags: review?(mbrubeck) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/61666a1574f2
Target Milestone: --- → Firefox 17
Comment on attachment 644523 [details] [diff] [review]
account for shadow in horizontal margins

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 774938 (native text selection handles)
User impact if declined: handles don't exactly line up with the selection ends
Testing completed (on m-c, etc.): just landed on inbound
Risk to taking this patch (and alternatives if risky): low-risk style change
String or UUID changes made by this patch: n/a
Attachment #644523 - Flags: approval-mozilla-beta?
Attachment #644523 - Flags: approval-mozilla-aurora?
Comment on attachment 644523 [details] [diff] [review]
account for shadow in horizontal margins

approved for beta/aurora as part of the dep bugs for native handles for text selection.
Attachment #644523 - Flags: approval-mozilla-beta?
Attachment #644523 - Flags: approval-mozilla-beta+
Attachment #644523 - Flags: approval-mozilla-aurora?
Attachment #644523 - Flags: approval-mozilla-aurora+
https://hg.mozilla.org/mozilla-central/rev/61666a1574f2
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: