private void calculateGridTranslation() { if (transformCells.getScaleX() >= SHOW_GRID_MIN_SCALE) { @SuppressWarnings("SuspiciousNameCombination") double modX = Math.floorMod(round(transformCells.getTranslateX()), cellWidth); double modY = Math.floorMod(round(transformCells.getTranslateY()), cellHeight); transformGrid.setToTranslation(-cellWidth + modX - 1, -cellHeight + modY - 1); } }