mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix border painting in presence of inlays
This commit is contained in:
@@ -777,8 +777,8 @@ class EditorPainter implements TextDrawingCallback {
|
||||
}
|
||||
}
|
||||
else if (startOffset < maxOffset && endOffset > minOffset) {
|
||||
float x1 = fragment.offsetToX(Math.max(minOffset, startOffset));
|
||||
float x2 = fragment.offsetToX(Math.min(maxOffset, endOffset));
|
||||
float x1 = minOffset == maxOffset ? fragment.getStartX() : fragment.offsetToX(Math.max(minOffset, startOffset));
|
||||
float x2 = minOffset == maxOffset ? fragment.getEndX() : fragment.offsetToX(Math.min(maxOffset, endOffset));
|
||||
if (x1 > x2) {
|
||||
float tmp = x1;
|
||||
x1 = x2;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 247 B |
@@ -116,6 +116,14 @@ public class EditorPaintingTest extends AbstractEditorTest {
|
||||
checkResult();
|
||||
}
|
||||
|
||||
public void testMultilineBorderWithInlays() throws Exception {
|
||||
initText("abc\ndef");
|
||||
myEditor.getInlayModel().addInlineElement(1, new MyInlayRenderer());
|
||||
myEditor.getInlayModel().addInlineElement(6, new MyInlayRenderer());
|
||||
addBorderHighlighter(0, 7, 0, Color.red);
|
||||
checkResult();
|
||||
}
|
||||
|
||||
private static void setUniformEditorHighlighter(TextAttributes attributes) {
|
||||
((EditorEx)myEditor).setHighlighter(new UniformHighlighter(attributes));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user