Skip to content

Commit 42bc574

Browse files
committed
fix(overlay): prevent blurry connected overlays
1 parent 41ad382 commit 42bc574

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
@@ -227,8 +227,9 @@ export class ConnectedPositionStrategy implements PositionStrategy {
227227
* @param overlayPoint
228228
*/
229229
private _setElementPosition(element: HTMLElement, overlayPoint: Point) {
230-
let x = overlayPoint.x;
231-
let y = overlayPoint.y;
230+
// Round the values to prevent blurry overlays due to subpixel rendering.
231+
let x = Math.round(overlayPoint.x);
232+
let y = Math.round(overlayPoint.y);
232233

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

0 commit comments

Comments
 (0)