File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,11 @@ def draw_offscreen_indicators(self):
7272 margin = 0
7373 r_size = 16 # size of the indicator rect
7474
75+ toolbar_width = self .editor .toolbar .width
76+
7577 def is_node_visible (screen_x , screen_y ):
7678 return (
77- TOOLBAR_WIDTH + margin < screen_x < screen_w - margin and
79+ toolbar_width + margin < screen_x < screen_w - margin and
7880 margin < screen_y < screen_h - margin
7981 )
8082
@@ -84,7 +86,7 @@ def get_screen_coords(node):
8486 (node .y * self .editor .zoom ) - self .editor .panning_state .offset_y * self .editor .zoom ,
8587 )
8688
87- center_x = TOOLBAR_WIDTH + (screen_w - TOOLBAR_WIDTH ) // 2
89+ center_x = toolbar_width + (screen_w - toolbar_width ) // 2
8890 center_y = screen_h // 2
8991
9092 for node in self .editor .nodes :
@@ -106,7 +108,7 @@ def get_screen_coords(node):
106108 # Determine intersection with window edge
107109 if abs (dx ) > abs (dy * (screen_w / screen_h )):
108110 # Left/Right edge
109- edge_x = screen_w - margin if dx > 0 else TOOLBAR_WIDTH + margin
111+ edge_x = screen_w - margin if dx > 0 else toolbar_width + margin
110112 edge_y = center_y + (edge_x - center_x ) * math .tan (angle )
111113 # Top/Bottom
112114 else :
You can’t perform that action at this time.
0 commit comments