Skip to content

Commit cf47916

Browse files
committed
fix(overlay): prevent blurry connected overlays
1 parent 8f0265c commit cf47916

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/core/overlay/position/connected-position-strategy.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ export class ConnectedPositionStrategy implements PositionStrategy {
217217
* @param overlayPoint
218218
*/
219219
private _setElementPosition(element: HTMLElement, overlayPoint: Point) {
220-
let x = overlayPoint.x;
221-
let y = overlayPoint.y;
220+
// Round the values to prevent blurry overlays due to subpixel rendering.
221+
let x = Math.round(overlayPoint.x);
222+
let y = Math.round(overlayPoint.y);
222223

223224
// TODO(jelbourn): we don't want to always overwrite the transform property here,
224225
// because it will need to be used for animations.

0 commit comments

Comments
 (0)