Skip to content

Commit 1f274ba

Browse files
committed
Move blit manager update out of mask highlights
This is so that we can better control it and ensure it is only called once, when needed. This fixes an issue where the old view would "flash" on the screen when you switch to any view except raw. Signed-off-by: Patrick Avery <[email protected]>
1 parent 4338c29 commit 1f274ba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hexrdgui/image_canvas.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,10 +1559,12 @@ def mask_highlights_changed(self):
15591559
self.clear_mask_highlights()
15601560
for det_name, ax in self.raw_axes.items():
15611561
self.highlight_masks(ax, det_name)
1562+
self.blit_manager.update()
15621563
return
15631564

15641565
if self.mode in (ViewType.polar, ViewType.stereo):
15651566
self.update_mask_highlights(self.axis)
1567+
self.blit_manager.update()
15661568

15671569
def polar_masks_changed(self):
15681570
skip = (
@@ -2280,9 +2282,10 @@ def draw_mask_boundaries(self, axis, det=None):
22802282
)
22812283

22822284
def highlight_masks(self, axis, det=None):
2285+
# Don't update the blit manager here, so we can better control
2286+
# it elsewhere
22832287
all_verts = self.get_mask_verts('highlights', det)
22842288
if not all_verts:
2285-
self.blit_manager.update()
22862289
return
22872290

22882291
kwargs = {
@@ -2300,8 +2303,6 @@ def highlight_masks(self, axis, det=None):
23002303
axis.add_patch(polygon)
23012304
highlight_artists.append(polygon)
23022305

2303-
self.blit_manager.update()
2304-
23052306
def remove_all_mask_highlight_artists(self):
23062307
self.blit_manager.remove_artists('mask_highlights')
23072308
self.blit_manager.artists['mask_highlights'] = {}

0 commit comments

Comments
 (0)