Browse Source

REPORT-41895 设计面板-SQL输入框的光标,闪烁时会留下一个小点

【问题原因】光标的长度比背景高亮要长,超出部分不会闪烁,因此留下小点
【改动思路】减小光标的竖直height
final/10.0
Yvan 4 years ago
parent
commit
ef933e235f
  1. 11
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/ConfigurableCaret.java

11
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/ConfigurableCaret.java

@ -2,7 +2,7 @@
* 12/21/2004
*
* ConfigurableCaret.java - The caret used by RTextArea.
*
*
* This library is distributed under a modified BSD license. See the included
* RSyntaxTextArea.License.txt file for details.
*/
@ -159,7 +159,7 @@ public class ConfigurableCaret extends DefaultCaret {
textArea.isRequestFocusEnabled()) {
if (inWindow)
textArea.requestFocusInWindow();
else
else
textArea.requestFocus();
}
}
@ -458,7 +458,8 @@ public class ConfigurableCaret extends DefaultCaret {
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(new BasicStroke(2));
// 向右再移动一个位置 避免光标太接近文字内容
g2.draw(new Line2D.Float(r.x + 1, r.y, r.x + 1, r.y + r.height));
// REPORT-41895 光标上方超出背景高亮的部分不会闪烁,会形成一个停留的小点,因此将光标的超出部分截去
g2.draw(new Line2D.Float(r.x + 1, r.y + 1, r.x + 1, r.y + r.height));
break;
} // End of switch (style).
@ -676,7 +677,7 @@ public class ConfigurableCaret extends DefaultCaret {
if (line<lineCount) {
dot = textArea.getLineStartOffset(line);
}
else { // No lower lines visible
else { // No lower lines visible
UIManager.getLookAndFeel().
provideErrorFeedback(textArea);
return;
@ -711,4 +712,4 @@ public class ConfigurableCaret extends DefaultCaret {
}
}
}

Loading…
Cancel
Save