Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset
Point p= textWidget.getLocationAtOffset(lineEnd);

Color c= gc.getForeground();
Color bg= gc.getBackground();
gc.setForeground(color);
gc.setBackground(color);

FontMetrics metrics= gc.getFontMetrics();

Expand All @@ -117,10 +119,12 @@ public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset
gc.drawRectangle(p.x, p.y + leading, (int) width, height);
int third= (int) (width / 3);
int dotsVertical= p.y + baseline - 1;
gc.drawPoint(p.x + third, dotsVertical);
gc.drawPoint((int) (p.x + width - third), dotsVertical);
// drawPoint stays one device pixel on Windows
gc.fillRectangle(p.x + third, dotsVertical, 1, 1);
gc.fillRectangle((int) (p.x + width - third), dotsVertical, 1, 1);

gc.setForeground(c);
gc.setBackground(bg);

} else {
textWidget.redrawRange(offset, length, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,16 @@ public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset

int[] polyline= computePolyline(left, right, textWidget.getBaseline(offset), textWidget.getLineHeight(offset));

gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
// width 0 stays one device pixel on Windows while the zigzag scales
int lineWidth= gc.getLineWidth();
gc.setLineWidth(1);
gc.setLineStyle(SWT.LINE_SOLID);
gc.setForeground(color);
int antialias= gc.getAntialias();
gc.setAntialias(SWT.ON);
gc.drawPolyline(polyline);
gc.setAntialias(antialias);
gc.setLineWidth(lineWidth);

} else {
textWidget.redrawRange(offset, length, true);
Expand Down
Loading