mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
paint all gutter backgrounds at once
This commit is contained in:
+9
-36
@@ -228,19 +228,20 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
|
||||
EditorUIUtil.setupAntialiasing(g);
|
||||
Color backgroundColor = getBackground();
|
||||
paintLineNumbersBackground(g, clip, backgroundColor);
|
||||
paintAnnotationsBackground(g, clip, backgroundColor);
|
||||
|
||||
// paint all backgrounds
|
||||
int gutterSeparatorX = getWhitespaceSeparatorOffset();
|
||||
paintBackground(g, clip, 0, gutterSeparatorX, backgroundColor);
|
||||
paintBackground(g, clip, gutterSeparatorX, getFoldingAreaWidth(), myEditor.getBackgroundColor());
|
||||
|
||||
int firstVisibleOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(0, clip.y - myEditor.getLineHeight())));
|
||||
int lastVisibleOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(0, clip.y + clip.height + myEditor.getLineHeight())));
|
||||
paintEditorBackgrounds(g, firstVisibleOffset, lastVisibleOffset);
|
||||
|
||||
Object hint = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
|
||||
if (!UIUtil.isRetina()) g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
|
||||
|
||||
try {
|
||||
int firstVisibleOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(0, clip.y - myEditor.getLineHeight())));
|
||||
int lastVisibleOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(0, clip.y + clip.height + myEditor.getLineHeight())));
|
||||
paintFoldingBackground(g, clip, backgroundColor);
|
||||
paintLineMarkersBackground(g, clip, backgroundColor);
|
||||
paintEditorBackgrounds(g, firstVisibleOffset, lastVisibleOffset);
|
||||
|
||||
paintAnnotations(g, clip);
|
||||
paintLineMarkers(g, firstVisibleOffset, lastVisibleOffset);
|
||||
paintFoldingLines(g, clip);
|
||||
@@ -347,12 +348,6 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
}
|
||||
}
|
||||
|
||||
private void paintAnnotationsBackground(Graphics g, Rectangle clip, Color backgroundColor) {
|
||||
int w = getAnnotationsAreaWidthEx();
|
||||
if (w == 0) return;
|
||||
paintBackground(g, clip, getAnnotationsAreaOffset(), w, backgroundColor);
|
||||
}
|
||||
|
||||
private void paintAnnotations(Graphics2D g, Rectangle clip) {
|
||||
int x = getAnnotationsAreaOffset();
|
||||
int w = getAnnotationsAreaWidthEx();
|
||||
@@ -412,12 +407,6 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
}
|
||||
}
|
||||
|
||||
private void paintLineMarkersBackground(Graphics g, Rectangle clip, Color bgColor) {
|
||||
if (isLineMarkersShown()) {
|
||||
paintBackground(g, clip, getLineMarkerAreaOffset(), getLineMarkerAreaWidth(), bgColor);
|
||||
}
|
||||
}
|
||||
|
||||
private void paintLineMarkers(Graphics2D g, int firstVisibleOffset, int lastVisibleOffset) {
|
||||
if (isLineMarkersShown()) {
|
||||
paintGutterRenderers(g, firstVisibleOffset, lastVisibleOffset);
|
||||
@@ -456,12 +445,6 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
}
|
||||
}
|
||||
|
||||
private void paintLineNumbersBackground(Graphics g, Rectangle clip, Color bgColor) {
|
||||
if (isLineNumbersShown()) {
|
||||
paintBackground(g, clip, getLineNumberAreaOffset(), getLineNumberAreaWidth(), bgColor);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getBackground() {
|
||||
if (myEditor.isInDistractionFreeMode() || !myPaintBackground) {
|
||||
@@ -962,16 +945,6 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
|
||||
}
|
||||
}
|
||||
|
||||
private void paintFoldingBackground(Graphics g, Rectangle clip, Color bgColor) {
|
||||
int lineX = getWhitespaceSeparatorOffset();
|
||||
paintBackground(g, clip, getFoldingAreaOffset(), getFoldingAreaWidth(), bgColor);
|
||||
|
||||
g.setColor(myEditor.getBackgroundColor());
|
||||
g.fillRect(lineX, clip.y, getFoldingAreaWidth(), clip.height);
|
||||
|
||||
paintCaretRowBackground(g, lineX, getFoldingAnchorWidth());
|
||||
}
|
||||
|
||||
private void paintFoldingLines(final Graphics2D g, final Rectangle clip) {
|
||||
if (!isFoldingOutlineShown()) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user