mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
fix situations where caret sometimes leaves single pixel trails
This commit is contained in:
@@ -19,6 +19,7 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.Line2D;
|
||||
|
||||
import javax.swing.ToolTipManager;
|
||||
import javax.swing.text.*;
|
||||
@@ -589,7 +590,10 @@ public class TextAreaPainter extends JComponent implements TabExpander {
|
||||
// the first column. the fix is to use drawLine() in
|
||||
// those cases, as a workaround.
|
||||
if (caretWidth == 1) {
|
||||
gfx.drawLine(caretX, y, caretX, y + height - 1);
|
||||
// workaround for single pixel dots showing up when caret
|
||||
// is rendered a single pixel too tall [fry 220129]
|
||||
((Graphics2D) gfx).draw(new Line2D.Float(caretX, y + 0.5f, caretX, y + height - 0.5f));
|
||||
//gfx.drawLine(caretX, y, caretX, y + height - 1);
|
||||
} else {
|
||||
gfx.drawRect(caretX, y, caretWidth - 1, height - 1);
|
||||
}
|
||||
|
||||
2
todo.txt
2
todo.txt
@@ -18,7 +18,7 @@ X users confirms the correctly working display swapped between beta 3 and 4
|
||||
X also updated the two older bugs
|
||||
X https://github.com/processing/processing4/issues/226
|
||||
X https://github.com/processing/processing4/issues/342
|
||||
|
||||
X caret is sometimes one pixel too tall
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user