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

TextLayer selection coloring improvement for overlap. #5282

Merged

Conversation

CodingFabian
Copy link
Contributor

As a consequence of merging #5221 it is more likely to have multiple
overlapping selection divs inside the text layer. Because each individual
element gets the selection style applied, the 30%opacity stacks, making a
60% bar visible where the overlap happens.

As proposed by @rocallahan, this can be fixed by making the selection
style solid and setting opacity for the overall layer.

I assume also that this should make the work for the renderer easier, but
was unable to bench it.

@CodingFabian
Copy link
Contributor Author

screenshots from the document of #1045
before:
screen shot 2014-09-09 at 09 00 06

after:
screen shot 2014-09-09 at 09 01 03

@Snuffleupagus
Copy link
Collaborator

Unfortunately these changes make the "find" highlight very difficult to spot, so this patch still needs some work.

@CodingFabian CodingFabian force-pushed the nicer-overlapping-text-selection branch from 26e8c01 to 9bbb8e7 Compare September 9, 2014 09:04
@CodingFabian
Copy link
Contributor Author

oops yeah, i forgot to include that factor in the two other alpha values for highlights. fixed now.

@Snuffleupagus
Copy link
Collaborator

The "find" highlights are still slightly lighter, but I don't know how much that matters.
(It looks like opacity might not be a linear property when it's "chained".)

@CodingFabian
Copy link
Contributor Author

no they are percentage. Its now 60% of 30% which is less than 20% which it was before. I assume that doesnt matter much. Maybe, we could even get rid of the 20% and make text selection and search highlight overall 30% (so remove the opacity from the highlight css)

@yurydelendik
Copy link
Contributor

Its now 60% of 30% which is less than 20%

So it shall be 66 or 67% ?

@CodingFabian
Copy link
Contributor Author

;-) If the exact color needs to be matched its not doable at all. We can do 0.66 for sure, but maybe its an option to go for 30% for all highlights (selection and find)?

As a consequence of merging mozilla#5221 it is more likely to have multiple
overlapping selection divs inside the text layer. Because each individual
element gets the selection style applied, the 30%opacity stacks, making a
60% bar visible where the overlap happens.

As proposed by @rocallahan, this can be fixed by making the selection
style solid and setting opacity for the overall layer.

I assume also that this should make the work for the renderer easier, but
was unable to bench it.
@CodingFabian CodingFabian force-pushed the nicer-overlapping-text-selection branch from 9bbb8e7 to 931b444 Compare September 9, 2014 13:22
@CodingFabian
Copy link
Contributor Author

i played a bit and settled on making the text selection 20% as well. i think thats even nicer than before. The change now keeps alpha values for find highlighting and makes text selection lighter, but more importantly overlapping seconds do not create darker areas anymore.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Sep 9, 2014

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/d60ddfff810bad3/output.txt

@timvandermeij
Copy link
Contributor

I agree with @CodingFabian that this looks a lot better than before (with the overlapping areas).

@CodingFabian
Copy link
Contributor Author

@yurydelendik what do you think? is it ok to align the selection opacity? and do you like how it looks now or does it need improvement?

brendandahl added a commit that referenced this pull request Sep 23, 2014
…ection

TextLayer selection coloring improvement for overlap.
@brendandahl brendandahl merged commit a2e8a5e into mozilla:master Sep 23, 2014
@timvandermeij
Copy link
Contributor

CodingFabian: thank you for the nice improvement!

@CodingFabian CodingFabian deleted the nicer-overlapping-text-selection branch September 23, 2014 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants