mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-349443 ui: fix VCS Log graph rendering with 'Set Background Image' feature enabled
IdeBackgroundUtil is not compatible with the blit scrolling. Normally, blit is already disabled by usage of transparent scrollbars. But 'com.intellij.ui.components.ScrollSettings.isNotSupportedYet' disables transparent scrollbars for tables, so it needs to be disabled explicitly. GitOrigin-RevId: fca2decea3ebb734998de622fe87e4b2be9ae000
This commit is contained in:
committed by
intellij-monorepo-bot
parent
571944883b
commit
dae16b1ef2
@@ -647,4 +647,13 @@ public class JBViewport extends JViewport implements ZoomableViewport {
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean computeBlit(int dx, int dy, Point blitFrom, Point blitTo, Dimension blitSize, Rectangle blitPaint) {
|
||||
if (JBSwingUtilities.hasCGTransform(this)) {
|
||||
return false; // disable blit scrolling
|
||||
}
|
||||
|
||||
return super.computeBlit(dx, dy, blitFrom, blitTo, blitSize, blitPaint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
package com.intellij.util.ui;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.util.LazyInitializer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -55,4 +57,14 @@ public final class JBSwingUtilities {
|
||||
}
|
||||
return gg;
|
||||
}
|
||||
|
||||
public static boolean hasCGTransform(@NotNull JComponent c) {
|
||||
Graphics2D dummyGraphics = DUMMY_GRAPHICS.get();
|
||||
return runGlobalCGTransform(c, dummyGraphics) != dummyGraphics;
|
||||
}
|
||||
|
||||
private static final LazyInitializer.LazyValue<Graphics2D> DUMMY_GRAPHICS = LazyInitializer.create(() -> {
|
||||
var image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
|
||||
return image.createGraphics();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user