mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch origin/master
This commit is contained in:
+16
-4
@@ -512,6 +512,16 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
|
||||
private PopupHandler myHandler;
|
||||
private JButton myErrorStripeButton;
|
||||
@Nullable private BufferedImage myCachedTrack;
|
||||
private ComponentAdapter myResizeListener = new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
dropCache();
|
||||
}
|
||||
};
|
||||
|
||||
public void dropCache() {
|
||||
myCachedTrack = null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -534,13 +544,15 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
|
||||
@Override
|
||||
public void installUI(JComponent c) {
|
||||
super.installUI(c);
|
||||
myCachedTrack = null;
|
||||
c.addComponentListener(myResizeListener);
|
||||
dropCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallUI(@NotNull JComponent c) {
|
||||
super.uninstallUI(c);
|
||||
myCachedTrack = null;
|
||||
c.removeComponentListener(myResizeListener);
|
||||
dropCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -660,7 +672,7 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
|
||||
|
||||
Rectangle componentBounds = c.getBounds();
|
||||
ProperTextRange docRange = ProperTextRange.create(0, (int)componentBounds.getHeight());
|
||||
if (myCachedTrack == null || myCachedTrack.getHeight() != componentBounds.getHeight()) {
|
||||
if (myCachedTrack == null) {
|
||||
myCachedTrack = UIUtil.createImage(componentBounds.width, componentBounds.height, BufferedImage.TYPE_INT_ARGB);
|
||||
myDirtyYPositions = docRange;
|
||||
paintTrackBasement(myCachedTrack.getGraphics(), new Rectangle(0, 0, componentBounds.width, componentBounds.height));
|
||||
@@ -678,7 +690,7 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
|
||||
if (myDirtyYPositions == null) myDirtyYPositions = docRange;
|
||||
repaint(imageGraphics, componentBounds.width, myDirtyYPositions);
|
||||
myDirtyYPositions = null;
|
||||
//c.repaint(); // because of model changing inside paintTrack, reschedule actual repaint with the right clip
|
||||
c.repaint(); // because of model changing inside paintTrack, reschedule actual repaint with the right clip
|
||||
}
|
||||
finally {
|
||||
((ApplicationImpl)ApplicationManager.getApplication()).editorPaintFinish();
|
||||
|
||||
Reference in New Issue
Block a user