fixing grid line painting
diff --git a/NatTable/src/org/eclipse/nebula/widgets/nattable/core/layer/impl/GridLineCellLayerPainter.xtend b/NatTable/src/org/eclipse/nebula/widgets/nattable/core/layer/impl/GridLineCellLayerPainter.xtend
index 483d197..de3f8f8 100644
--- a/NatTable/src/org/eclipse/nebula/widgets/nattable/core/layer/impl/GridLineCellLayerPainter.xtend
+++ b/NatTable/src/org/eclipse/nebula/widgets/nattable/core/layer/impl/GridLineCellLayerPainter.xtend
@@ -26,8 +26,8 @@
val cellBounds = super.getPaintRegion(cell)
new PixelRectangle(
- cellBounds.x + 1,
- cellBounds.y + 1,
+ cellBounds.x,
+ cellBounds.y,
cellBounds.width - 1,
cellBounds.height - 1
)
@@ -44,23 +44,22 @@
val pixelWidth = layer.getPixelWidth
val pixelHeight = layer.getPixelHeight
- for (columnPosition : 0 .. layer.getColumnCount) {
- val startX = layer.getStartXPixelOfColumnPosition(columnPosition)
- for (rowPosition : 0 .. layer.getRowCount) {
- val startY = layer.getStartYPixelOfRowPosition(rowPosition)
-
- // Draw horizontal grid lines
- gc.drawLine(
- 0, startY,
- pixelWidth, startY
- )
-
- // Draw vertical grid lines
- gc.drawLine(
- startX, 0,
- startX, pixelHeight
- )
- }
+ // Draw horizontal grid lines
+ for (rowPosition : 1 .. layer.getRowCount) {
+ val startY = layer.getStartYPixelOfRowPosition(rowPosition) - 1
+ gc.drawLine(
+ 0, startY,
+ pixelWidth, startY
+ )
+ }
+
+ // Draw vertical grid lines
+ for (columnPosition : 1 .. layer.getColumnCount) {
+ val startX = layer.getStartXPixelOfColumnPosition(columnPosition) - 1
+ gc.drawLine(
+ startX, 0,
+ startX, pixelHeight
+ )
}
gc.popState