mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
marks disappear on editor resize
This commit is contained in:
@@ -809,7 +809,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
myPanel.addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
myMarkupModel.repaint(0, myDocument.getTextLength());
|
||||
myMarkupModel.recalcEditorDimensions();
|
||||
myMarkupModel.repaint(-1, -1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1570,7 +1571,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
myEditorComponent.setSize(dim);
|
||||
myEditorComponent.fireResized();
|
||||
|
||||
myMarkupModel.repaint(0, myDocument.getTextLength());
|
||||
myMarkupModel.recalcEditorDimensions();
|
||||
myMarkupModel.repaint(-1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -112,7 +112,7 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
|
||||
return myMinMarkHeight;
|
||||
}
|
||||
|
||||
private void recalcEditorDimensions() {
|
||||
void recalcEditorDimensions() {
|
||||
EditorImpl.MyScrollBar scrollBar = myEditor.getVerticalScrollBar();
|
||||
int scrollBarHeight = scrollBar.getSize().height;
|
||||
|
||||
@@ -751,10 +751,10 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
|
||||
LOG.assertTrue(success);
|
||||
}
|
||||
|
||||
public void markDirtied(@NotNull ProperTextRange pos) {
|
||||
int start = Math.max(0, pos.getStartOffset() - myEditor.getLineHeight());
|
||||
int end = myEditorScrollbarTop + myEditorTargetHeight == 0 ? pos.getEndOffset() + myEditor.getLineHeight()
|
||||
: Math.min(myEditorScrollbarTop + myEditorTargetHeight, pos.getEndOffset() + myEditor.getLineHeight());
|
||||
public void markDirtied(@NotNull ProperTextRange yPositions) {
|
||||
int start = Math.max(0, yPositions.getStartOffset() - myEditor.getLineHeight());
|
||||
int end = myEditorScrollbarTop + myEditorTargetHeight == 0 ? yPositions.getEndOffset() + myEditor.getLineHeight()
|
||||
: Math.min(myEditorScrollbarTop + myEditorTargetHeight, yPositions.getEndOffset() + myEditor.getLineHeight());
|
||||
ProperTextRange adj = new ProperTextRange(start, Math.max(end, start));
|
||||
|
||||
if (myDirtyYPositions == null) {
|
||||
|
||||
Reference in New Issue
Block a user