Skip to content

Tag: Scale

Fractional Scale Factors

With all the Retina/HiDPI work done in the past few years, we’ve had to add some new features along with it. One of these newer features is the Graphics ScaleX and ScaleY properties.  For the purposes of Retina/HiDPI, the scale factor is used when converting user space coordinates to backing store coordinates.  While mostly integral on MacOS (unless originating from some code that’s probably not ours), it can vary on Windows, and perhaps arguably mostly fractional.  This is because Windows allows you to set DPI scales at 125%, 150%, etc. So when dealing with fractional scales there are a few things to watch out for:

  1. Rounding issues
  2. Anti-alias effect

While the framework takes care of rounding issues, for the most part, the secondary issue of anti-aliasing is up to you.

Comments closed