(GetScreenHeight returns 1050 for me, which is my actual Y-resolution.)

The general technique is still useful if you want to be able to scale frames without scaling certain elements (e.g. 1-pixel border on a scalable map). Or for people who use uiscale but want a certain element to render at pixel scale. That said I'm still not entirely sure what needs to be changed in order for that to work in 4.0.1.

Has anyone considered the prospect that in 4.0.1 any element needing a pixel perfect border needs to be placed on the screen with whole numbers for x and y values? I'm not very proficient in LUA or how the interface works, but I can find my way around, but I assume for anything dragable the values are typically never whole numbers, as evidence from looking at various SavedVariable files over the years.

Edit 1: Also height/width need to be whole numbers as well.

Edit 2: Also it looks like the height/width values need to be divisible by 2, but x/y values do not.

Back in 3.3.5 I used 0.7 for my uiScale, I ended up getting my Stuf frames to be pixel perfect simply by adjusting the x and y values of the frame... just placing them at a certain location on the screen. If I moved them 1 px, usually one edge would become blurry.

Well I'm trying to adjust my LitePanels on beta at the moment, going for a 0.64 uiScale on 1920x1200, and I noticed whenever I put the x value to a number with a decimal the borders become fuzzy.

Weird, tried to run various "perfect uiscale" macros but none made the anti-aliasing addon written some posts ago, show poor rendered lines where the black and white borders smear together.

I guess we can't get it perfect when running window mode maximized, the resolution is something like 1920.00019234 and the height is 1060.111052 or similar, point is I got a 1920x1080 screen and apparently the decimals somehow mess it up when it's not exactly 16:9 scaled.

If it doesn't show smeared lines, it's perfect - what more do you want?

Typo, I meant that the anti-aliasing addon showed lines in the square that were smeared. In fact none looked proper, no mater what macro I used. It also is like this even when disabling the uiscale and letting the game handle it by itself. I guess that resolution simply can't have a perfect uiscale as it's not perfectly scaled to 16:9 or other acceptable ratios sized.

I'm a bit puzzled why it's preferable to use no uiscale. Wouldn't all of the screen elements be huge? I know I would have to go into each addon and resize/rescale them - seems like in the end you would be in the same place as just using uiscale via the calculations from earlier in the thread.

Not doubting anything anyone is saying, just trying to understand which is the right way to go.

I'm a bit puzzled why it's preferable to use no uiscale. Wouldn't all of the screen elements be huge? I know I would have to go into each addon and resize/rescale them - seems like in the end you would be in the same place as just using uiscale via the calculations from earlier in the thread.

Not doubting anything anyone is saying, just trying to understand which is the right way to go.

Without the ui scale, UI elements in game will be proportionate to your monitors screen resolution. A lot of UI's were already turning off the ui scale feature in game (Tukui and nUI just to name a few) long before Blizz made their recent change.

I used to turn my UI Scale down. With the recent change, I have to turn it up.

__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

My interest in this topic was to provide pixel perfection without altering how the users ui works (so the user can set "Use UI Scale", "Windowed" mode etc as they wish).

I've found the following:

Use UI Scale: Off

Then UIParent will always match the pixel size of your window client area... I say client area, because this also holds true when you go windowed mode and resize the window.. In this mode things are easy as you are always working in the desired size.

Use UI Scale: On

Not so easy.
While it is possible to get the resolution and then do conversions along the following lines (psuedo code)

It won't work for windowed mode unfortunately, as none of those numbers will adjust when the size of the window changes nor am I aware of any attribute that provide the the new scale/dimensions of the window.

This can be a bit tricky, because it does mean if the user does go windowed and UI Scale is on, that you may start to have details drop out (although I chose not to use the technique so far, I would have had single pixel lines that sometimes don't show up)

I can't get this to work correctly.
I'm using a windowed setup on a 1920x1080 resolution. My available screen size for WoW, due to the task and header bar, is 1018 pixels in height.

According to the formulae I should be using a UIScale of 768/1018 = 0.75442.
However that doesn't work, I do not get clean borders, they're still blurred. Using 768/1080 = 0.71111... doesn't work either, nor does disabling UI scale altogether.

Switching to fullscreen mode makes 768/1080 work, I get clean and sharp edges, at least for kgpanels (but not for Shadowed Unitframes?).
However I do want to keep the game in windowed mode.
Does anybody have any ideas?

I can't get this to work correctly.
I'm using a windowed setup on a 1920x1080 resolution. My available screen size for WoW, due to the task and header bar, is 1018 pixels in height.

According to the formulae I should be using a UIScale of 768/1018 = 0.75442.
However that doesn't work, I do not get clean borders, they're still blurred. Using 768/1080 = 0.71111... doesn't work either, nor does disabling UI scale altogether.

Switching to fullscreen mode makes 768/1080 work, I get clean and sharp edges, at least for kgpanels (but not for Shadowed Unitframes?).
However I do want to keep the game in windowed mode.
Does anybody have any ideas?

I believe you need a resolution less than your maximum for pixel perfection in windowed mode. The game is still running at 1080 vertical even though your viewable is being reduced. Custom values in config.wtf work for this e.g. SET gxResolution "1920x1018" before you load the game.