fix painting error stripes into cached image

This commit is contained in:
Sergey Malenkov
2017-12-06 16:43:26 +03:00
parent 7b9e53cb39
commit 9a929629f5
2 changed files with 4 additions and 3 deletions
@@ -15,6 +15,7 @@
*/
package com.intellij.ui.stripe;
import com.intellij.util.ui.ImageUtil;
import com.intellij.util.ui.RegionPainter;
import java.awt.AlphaComposite;
@@ -164,8 +165,8 @@ public class ErrorStripePainter extends RegionPainter.Image {
}
private void updateImage(BufferedImage image, boolean force) {
int width = image.getWidth();
int height = image.getHeight();
int width = ImageUtil.getUserWidth(image);
int height = ImageUtil.getUserHeight(image);
Graphics2D g = image.createGraphics();
myImageHeight = 0;
@@ -134,7 +134,7 @@ public interface RegionPainter<T> {
@Override
public void paint(Graphics2D g, int x, int y, int width, int height, Object object) {
if (width > 0 && height > 0) {
if (myImage == null || width != myImage.getWidth() || height != myImage.getHeight()) {
if (myImage == null || width != ImageUtil.getUserWidth(myImage) || height != ImageUtil.getRealHeight(myImage)) {
myImage = createImage(width, height);
}
else if (myImage != null) {