avoid gaps in selection rendering for fractional coordinates - use proper rounding

This commit is contained in:
Dmitry Batrak
2015-12-10 20:32:12 +03:00
parent 2f0cb5aa45
commit 06091bb887
@@ -261,7 +261,9 @@ class EditorPainter implements TextDrawingCallback {
color.equals(myEditor.getColorsScheme().getDefaultBackground()) ||
color.equals(myEditor.getBackgroundColor())) return;
g.setColor(color);
g.fillRect((int)x, y, (int)width, myView.getLineHeight());
int xStartRounded = (int)x;
int xEndRounded = (int)(x + width);
g.fillRect(xStartRounded, y, xEndRounded - xStartRounded, myView.getLineHeight());
}
private void paintCustomRenderers(final Graphics2D g, final int startOffset, final int endOffset) {