npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

scale-fix

v0.0.3

Published

Angular library that corrects Windows display scaling between 110% and 175%.

Readme

scale-fix

Angular library that corrects Windows display scaling so an application keeps its 100% layout.

Windows display scaling between 110% and 175% raises devicePixelRatio above 1. Text, layout, and charts then render larger than designed. ScaleFixService applies the inverse CSS zoom on the document element and dispatches a resize event so chart libraries redraw at the corrected size.

Scaling at 100%, and scaling outside the configured range (for example 200%), is left unchanged. Manual browser zoom (Ctrl/Cmd + -, pinch) stays fully functional: the OS compensation is held steady while page zoom changes devicePixelRatio.

Installation

npm install scale-fix

Peer dependencies:

| Package | Version | | --- | --- | | @angular/core | >=12.0.0 | | @angular/common | >=12.0.0 |

The same package works in an Angular 12 project and in later majors, including future ones. It is published as partial Ivy, and the application links it with its own Angular compiler. Angular versions older than 12 cannot consume that format.

Usage

ScaleFixService is provided in the root injector. Call init() once when the application starts.

import { Component } from '@angular/core';
import { ScaleFixService } from 'scale-fix';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
})
export class AppComponent {
  constructor(private readonly scaleFix: ScaleFixService) {
    this.scaleFix.init();
  }
}

On Angular 14 or later, inject(ScaleFixService) works the same way.

Pass a custom inclusive range when the defaults are not the ones you want. Values are devicePixelRatio units (1.25 is 125% scaling).

this.scaleFix.init(1.25, 1.5);

API

init(min = 1.1, max = 1.75): void

Reads window.devicePixelRatio, sets zoom on <html>, and listens for resize so the correction follows display-scale changes.

| devicePixelRatio | Display scaling | Result | | --- | --- | --- | | Below min or above max | for example 100% or 200% | No correction (zoom stays 1) | | From min through max | 110%–175% by default | zoom is set to 1 / devicePixelRatio |

init() is safe to call more than once. The resize listener is registered only on the first call.

On the server, init() does nothing.

How it works

  1. Read window.devicePixelRatio (default 1).
  2. If the ratio is inside [min, max], set document.documentElement zoom to 1 / devicePixelRatio.
  3. On resize, detect Ctrl+/- page zoom (DPR and CSS viewport width move in inverse proportion). In that case keep the existing zoom so user zoom is not cancelled.
  4. Otherwise treat the change as a display-scale change and recompute the correction.
  5. Skip the update when the factor has not changed.
  6. Dispatch a resize event on the next turn so charts and other resize-aware widgets redraw.

License

MIT © 2026 Om Dixit

Anyone may use, copy, modify, publish, distribute, sublicense, and sell this library, including in commercial applications. Copies must keep the copyright notice and the permission notice.