@@ -95,8 +95,9 @@ def redraw_legend(self, force_show=False):
95
95
def draw_sep_area (self , centers : np .ndarray , show_symbols = False ):
96
96
x = self .sceneRect ().x ()
97
97
y = self .sceneRect ().y ()
98
- h = self .sceneRect ().height ()
99
98
w = self .sceneRect ().width ()
99
+ h = self .sceneRect ().height ()
100
+ reversed_centers = list (reversed (centers ))
100
101
101
102
num_areas = len (centers ) + 1
102
103
if num_areas != len (self .separation_areas ):
@@ -115,15 +116,15 @@ def draw_sep_area(self, centers: np.ndarray, show_symbols=False):
115
116
self .addItem (area )
116
117
self .separation_areas .append (area )
117
118
118
- start = y + h
119
+ start = y
119
120
120
121
for i , area in enumerate (self .separation_areas ):
121
122
area .show ()
122
123
try :
123
- self .separation_areas [i ].setRect (x , start , w , - (start - centers [i ]))
124
- start -= (start - centers [i ])
124
+ self .separation_areas [i ].setRect (x , start , w , abs (start - reversed_centers [i ]))
125
+ start += abs (start - reversed_centers [i ])
125
126
except IndexError :
126
- self .separation_areas [i ].setRect (x , start , w , - (start - y ))
127
+ self .separation_areas [i ].setRect (x , start , w , abs (start - h ))
127
128
128
129
if self .noise_area is not None :
129
130
self .noise_area .hide ()
0 commit comments