mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix caret blinking
This commit is contained in:
@@ -3202,8 +3202,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CaretRectangle[] getCaretLocations() {
|
||||
return myCaretCursor.getCaretLocations();
|
||||
public CaretRectangle[] getCaretLocations(boolean onlyIfShown) {
|
||||
return myCaretCursor.getCaretLocations(onlyIfShown);
|
||||
}
|
||||
|
||||
private void paintLineMarkersSeparators(@NotNull final Graphics g,
|
||||
@@ -4761,13 +4761,13 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private CaretRectangle[] getCaretLocations() {
|
||||
if (!isEnabled() || !myIsShown || isRendererMode() || !IJSwingUtilities.hasFocus(getContentComponent())) return null;
|
||||
private CaretRectangle[] getCaretLocations(boolean onlyIfShown) {
|
||||
if (onlyIfShown && (!isEnabled() || !myIsShown || isRendererMode() || !IJSwingUtilities.hasFocus(getContentComponent()))) return null;
|
||||
return myLocations;
|
||||
}
|
||||
|
||||
private void paint(@NotNull Graphics g) {
|
||||
CaretRectangle[] locations = getCaretLocations();
|
||||
CaretRectangle[] locations = getCaretLocations(true);
|
||||
if (locations == null) return;
|
||||
|
||||
for (CaretRectangle location : myLocations) {
|
||||
|
||||
@@ -638,7 +638,7 @@ class EditorPainter {
|
||||
}
|
||||
|
||||
private void paintCaret(Graphics2D g_) {
|
||||
EditorImpl.CaretRectangle[] locations = myEditor.getCaretLocations();
|
||||
EditorImpl.CaretRectangle[] locations = myEditor.getCaretLocations(true);
|
||||
if (locations == null) return;
|
||||
|
||||
Graphics2D g = IdeBackgroundUtil.getOriginalGraphics(g_);
|
||||
@@ -689,7 +689,7 @@ class EditorPainter {
|
||||
}
|
||||
|
||||
void repaintCarets() {
|
||||
EditorImpl.CaretRectangle[] locations = myEditor.getCaretLocations();
|
||||
EditorImpl.CaretRectangle[] locations = myEditor.getCaretLocations(false);
|
||||
if (locations == null) return;
|
||||
int lineHeight = myView.getLineHeight();
|
||||
for (EditorImpl.CaretRectangle location : locations) {
|
||||
|
||||
@@ -172,7 +172,7 @@ final class ArgumentHintLayer extends JPanel implements Listener, Runnable { //
|
||||
: argumentText);
|
||||
|
||||
// Update caret position (if known)
|
||||
final CaretRectangle[] locations = consoleEditor.getCaretLocations();
|
||||
final CaretRectangle[] locations = consoleEditor.getCaretLocations(true);
|
||||
if (locations != null) {
|
||||
final CaretRectangle rectangle = locations[0];
|
||||
myCaretPositionPx = rectangle.myPoint.x;
|
||||
|
||||
Reference in New Issue
Block a user