Skip to content

fix(select): panel content blurry in some browsers #11434

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

Merged
merged 1 commit into from
May 23, 2018

Conversation

crisbeto
Copy link
Member

After we switched everything over to the FlexibleConnectedPositionStrategy, we started using transform to handle overlay offsets, however using a subpixel transform value will cause some browsers to blur the content of the element. These changes round the select's transforms so the content isn't blurry.

For reference:

1
2

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 21, 2018
After we switched everything over to the `FlexibleConnectedPositionStrategy`, we started using `transform` to handle overlay offsets, however using a subpixel `transform` value will cause some browsers to blur the content of the element. These changes round the select's transforms so the content isn't blurry.
@crisbeto crisbeto force-pushed the select-blurry-content branch from 669127e to d4724bf Compare May 21, 2018 14:38
expect(origin).toBe(expectedOrigin,
// Because the origin depends on the Y axis offset, we also have to
// round down and check that the difference is within a pixel.
expect(Math.abs(expectedOrigin - origin) < 2).toBe(true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use Math.floor or Math.ceil to avoid this absolute check?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine; using abs is the canonical way of checking the magnitude of a delta when you don't care about which is larger

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels May 22, 2018
@mmalerba mmalerba merged commit 3dc3fcd into angular:master May 23, 2018
mmalerba pushed a commit that referenced this pull request May 24, 2018
After we switched everything over to the `FlexibleConnectedPositionStrategy`, we started using `transform` to handle overlay offsets, however using a subpixel `transform` value will cause some browsers to blur the content of the element. These changes round the select's transforms so the content isn't blurry.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants