Skip to content

Commit e50a60f

Browse files
committed
grid size clean up
1 parent bbf94bb commit e50a60f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

NodeGraphQt/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
VIEWER_BG_COLOR = (35, 35, 35)
6464
VIEWER_GRID_COLOR = (45, 45, 45)
6565
VIEWER_GRID_OVERLAY = True
66+
VIEWER_GRID_SIZE = 20
6667

6768
SCENE_AREA = 8000.0
6869

NodeGraphQt/widgets/scene.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from NodeGraphQt import QtGui, QtCore, QtWidgets
33

44
from NodeGraphQt.constants import (VIEWER_BG_COLOR,
5+
VIEWER_GRID_SIZE,
56
VIEWER_GRID_OVERLAY,
67
VIEWER_GRID_COLOR)
78

@@ -47,17 +48,16 @@ def drawBackground(self, painter, rect):
4748
return
4849

4950
zoom = self.viewer().get_zoom()
50-
grid_size = 20
5151

5252
if zoom > -0.5:
5353
pen = QtGui.QPen(QtGui.QColor(*self.grid_color), 0.65)
54-
self._draw_grid(painter, rect, pen, grid_size)
54+
self._draw_grid(painter, rect, pen, VIEWER_GRID_SIZE)
5555

5656
color = bg_color.darker(150)
5757
if zoom < -0.0:
5858
color = color.darker(100 - int(zoom * 110))
5959
pen = QtGui.QPen(color, 0.65)
60-
self._draw_grid(painter, rect, pen, grid_size * 8)
60+
self._draw_grid(painter, rect, pen, VIEWER_GRID_SIZE * 8)
6161

6262
# fix border issue on the scene edge.
6363
pen = QtGui.QPen(bg_color, 2)

0 commit comments

Comments
 (0)