void runAllPainters(Graphics gg, @Nullable Offsets offsets) {
    if (painters.isEmpty() || offsets == null) {
      return;
    }

    Graphics2D g = (Graphics2D)gg;
    AffineTransform orig = g.getTransform();
    int i = 0;
    for (Painter painter : painters) {
      if (!painter.needsRepaint()) {
        continue;
      }

      Component cur = painterToComponent.get(painter);
      // restore transform at the time of computeOffset()
      g.setTransform(offsets.transform);
      g.translate(offsets.offsets[i++], offsets.offsets[i++]);
      painter.paint(cur, g);
    }
    g.setTransform(orig);
  }
void runAllPainters(Graphics gg, @Nullable Offsets offsets)