We found drawing artifacts when moving a Component around when using HiDPI on a system that has a non-integer scale factor (i.e. Display Settings set to 175% or 125%). The problem seems to be that HWNDComponentPeer::repaint() rounds the rectangle to be invalidated rather than expanding to the smallest integer container. The following change fixes it for us:
void repaint (const Rectangle<int>& area) override
{
...
- const RECT r = { roundToInt (area.getX() * scale), roundToInt (area.getY() * scale),
- roundToInt (area.getRight() * scale), roundToInt (area.getBottom() * scale) };
+ Rectangle<double> scaledArea = area.toDouble() * scale;
+ const RECT r = RECTFromRectangle(scaledArea.getSmallestIntegerContainer());
InvalidateRect (hwnd, &r, FALSE);
}
Thanks for taking a look!
