Slate line rendering: inconsistent scaling

Applying a layout scale to Slate line elements results in different thicknesses for AA vs non-AA lines.

The following screenshots show a green antialiased line and a blue non-antialiased line, drawn with the same endpoints and thickness.

At 1:1 layout scale with DPI scale 1, AA lines are the same thickness as non-AA lines (as expected):

When the editor is zoomed in (which changes the layout scale), the lines are different thicknesses:

This happens for any layout scale that zooms in on the element, not just when using the editor to zoom in. It affects lines drawn by C++ calls to FSlateDrawElement::MakeLine(s) and those drawn from UMG using the widget blueprint library’s DrawLine(s) functions.

Repro steps

  1. Make a new blueprint project in UE4.27
  2. Create a new widget blueprint and open it
  3. Switch to “Graph” view and override the “OnPaint” function
  4. Add two calls to Draw Line: one antialiased and the other not, same endpoints, same thickness (must be >1)

    eg:

  1. Compile the blueprint
  2. Switch to the “Designer” view and ensure DPI Scale is 1 (I used Screen Size → Monitors → 21.5-24" monitor)

Observe:

At 1:1 zoom with DPI scale 1 the two lines appear to have the same thickness. When zoomed in the non-antialiased line appears thicker than the antialiased line

Expected:

At any layout scale the non-antialiased line appears the same thickness as the antialiased line (AA filter width excluded)