From 537cd4ea756fb4b48a0f4d02927211feedcd579c Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Sat, 18 Apr 2015 01:58:52 +0300 Subject: [PATCH] simplify the tile painting code --- .../com/intellij/openapi/wm/impl/PaintersHelper.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/PaintersHelper.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/PaintersHelper.java index 2a33099f6f71..fecf3498c198 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/PaintersHelper.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/PaintersHelper.java @@ -242,16 +242,9 @@ final class PaintersHelper implements Painter.Listener { UIUtil.drawImage(g, scaled, x, y, null); } else if (fillType == FillType.TILE) { - int x = i.left; - int y = i.top; - while (w > 0 && x < cw) { - while (h > 0 && y < ch) { + for (int x = i.left; x < cw; x+=w) + for (int y = i.top; y < ch; y+=h) UIUtil.drawImage(g, scaled, x, y, null); - y += h; - } - y = 0; - x += w; - } } cfg.restore(); }