|
1 | 1 | /* |
2 | 2 | * MIT License |
3 | 3 | * |
4 | | - * Copyright (c) 2019-2021 Jannis Weis |
| 4 | + * Copyright (c) 2019-2025 Jannis Weis |
5 | 5 | * |
6 | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and |
7 | 7 | * associated documentation files (the "Software"), to deal in the Software without restriction, |
@@ -194,6 +194,7 @@ public void paintSingleCell(final Graphics2D g, final int h, final TableColumnMo |
194 | 194 | public void paintDraggedArea(final Graphics2D g, final boolean ltr, final int cMin, final int cMax, |
195 | 195 | final Color borderColor, final TableColumn draggedColumn) { |
196 | 196 | int draggedColumnIndex = viewIndexForColumn(draggedColumn); |
| 197 | + if (draggedColumnIndex < 0) return; |
197 | 198 | boolean scrollPaneRtl = isScrollPaneRtl(); |
198 | 199 | Rectangle draggedCellRect = header.getHeaderRect(draggedColumnIndex); |
199 | 200 | int dist = DarkTableUI.adjustDistance(header.getDraggedDistance(), draggedCellRect, header.getTable()); |
@@ -270,6 +271,7 @@ public void paintDraggedArea(final Graphics2D g, final boolean ltr, final int cM |
270 | 271 | } |
271 | 272 |
|
272 | 273 | protected void paintCell(final Graphics g, final Rectangle cellRect, final int columnIndex) { |
| 274 | + if (columnIndex < 0) return; |
273 | 275 | Component component = getHeaderCellRenderer(columnIndex); |
274 | 276 | rendererPane.paintComponent(g, component, header, cellRect.x, cellRect.y, cellRect.width, cellRect.height, |
275 | 277 | true); |
|
0 commit comments