Unwanted borders when scaling UI with opaque components

For the CoreGraphics renderer the following would be sensible:

void CoreGraphicsContext::fillRect (const Rectangle<int>& r, bool replaceExistingContents)
{
    CGContextSetAllowsAntialiasing(context.get(), false);
    fillCGRect (CGRectMake (r.getX(), flipHeight - r.getBottom(), r.getWidth(), r.getHeight()), replaceExistingContents);
    CGContextSetAllowsAntialiasing(context.get(), true);
}

there’s also the float variant with would still allow to fill a rect with antialiasing.

Without the above edges of opaque children of scaled components are just a mess. clipObscuredRegions() clips against the bounds of the opaque children and the children then (usually) will draw with AA enabled. Clipping regions obscured by opaque child components is an optimisation and enabling AA for this doesn’t make sense because a physical pixel either is visible or it isn’t. and if you clip without AA the bounds of the opaque children need to be filled in the same manner - without AA.

I think the software renderer also renders int rects without AA.

There are several other options to mitigate this:

  1. draw int rects without AA
  2. disable AA for rect drawn via fillAll()
  3. extend Graphics and LowLevelGraphicsContext and its children to let the user enable and disable AA