mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't paint in the overlapped region
This commit is contained in:
@@ -45,7 +45,7 @@ class ConsoleGutterComponent extends JComponent implements MouseMotionListener {
|
||||
this.atLineStart = atLineStart;
|
||||
|
||||
if (atLineStart) {
|
||||
setOpaque(gutterContentProvider.getStartLineOverlap(editor) == 0);
|
||||
setOpaque(gutterContentProvider.getLineStartGutterOverlap(editor) == 0);
|
||||
}
|
||||
else {
|
||||
addListeners();
|
||||
@@ -123,13 +123,18 @@ class ConsoleGutterComponent extends JComponent implements MouseMotionListener {
|
||||
((ApplicationImpl)ApplicationManager.getApplication()).editorPaintStart();
|
||||
try {
|
||||
Rectangle clip = g.getClipBounds();
|
||||
if (clip.height < 0 || maxContentWidth == 0) {
|
||||
if (clip.height <= 0 || maxContentWidth == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (atLineStart) {
|
||||
// don't paint in the overlapped region
|
||||
if (clip.x >= maxContentWidth) {
|
||||
return;
|
||||
}
|
||||
|
||||
g.setColor(editor.getBackgroundColor());
|
||||
g.fillRect(clip.x, clip.y, clip.width == getWidth() ? (clip.width - gutterContentProvider.getStartLineOverlap(editor)) : clip.width, clip.height);
|
||||
g.fillRect(clip.x, clip.y, Math.min(clip.width, maxContentWidth - clip.x), clip.height);
|
||||
}
|
||||
|
||||
UISettings.setupAntialiasing(g);
|
||||
|
||||
@@ -34,7 +34,7 @@ public abstract class GutterContentProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getStartLineOverlap(@NotNull Editor editor) {
|
||||
public int getLineStartGutterOverlap(@NotNull Editor editor) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -251,7 +251,7 @@ public final class LanguageConsoleBuilder {
|
||||
int w = getWidth();
|
||||
int h = getHeight();
|
||||
int lineStartGutterWidth = lineStartGutter.getPreferredSize().width;
|
||||
lineStartGutter.setBounds(0, 0, lineStartGutterWidth + gutterContentProvider.getStartLineOverlap(editor.getEditor()), h);
|
||||
lineStartGutter.setBounds(0, 0, lineStartGutterWidth + gutterContentProvider.getLineStartGutterOverlap(editor.getEditor()), h);
|
||||
|
||||
editor.setBounds(lineStartGutterWidth, 0, w - lineStartGutterWidth, h);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user