diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java index 8572df500c3a..c33b3833f172 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/StripeButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,8 +184,14 @@ public final class StripeButton extends AnchoredButton implements ActionListener myDragPane = findLayeredPane(e); if (myDragPane == null) return; - final BufferedImage image = UIUtil.createImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB); - paint(image.getGraphics()); + int width = getWidth() - 1; // -1 because StripeButtonUI.paint will not paint 1 pixel in case (anchor == ToolWindowAnchor.LEFT) + int height = getHeight() - 1; // -1 because StripeButtonUI.paint will not paint 1 pixel in case (anchor.isHorizontal()) + BufferedImage image = UIUtil.createImage(width, height, BufferedImage.TYPE_INT_RGB); + Graphics graphics = image.getGraphics(); + graphics.setColor(UIUtil.getBgFillColor(getParent())); + graphics.fillRect(0, 0, width, height); + paint(graphics); + graphics.dispose(); myDragButtonImage = new JLabel(new JBImageIcon(image)) { public String toString() {