mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
GeoTIFF: Fix crashes at 'cannot remove artist'.
This commit is contained in:
1 parent
da78d0cdb1
commit
8182d434ec
2 files changed
+10
-4
No files matched your search
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from tools import trace, timer
|
from tools import trace, timer, logger_exception
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QAction, QListView, QVBoxLayout,
|
QAction, QListView, QVBoxLayout,
|
||||||
@@ -134,7 +134,10 @@ class GeoTIFFListWindow(PamhyrWindow):
|
|||||||
|
|
||||||
def _update_rectangle(self):
|
def _update_rectangle(self):
|
||||||
for rect in self._plot_rect:
|
for rect in self._plot_rect:
|
||||||
rect.remove()
|
try:
|
||||||
|
rect.remove()
|
||||||
|
except Exception as e:
|
||||||
|
logger_exception(e)
|
||||||
|
|
||||||
self._plot_rect = []
|
self._plot_rect = []
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import logging
|
|||||||
|
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
from tools import timer, trace
|
from tools import timer, trace, logger_exception
|
||||||
from View.Tools.PamhyrPlot import PamhyrPlot
|
from View.Tools.PamhyrPlot import PamhyrPlot
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from matplotlib import collections
|
from matplotlib import collections
|
||||||
@@ -332,7 +332,10 @@ class PlotXY(PamhyrPlot):
|
|||||||
lst = self._data[0]._study.river._geotiff.lst
|
lst = self._data[0]._study.river._geotiff.lst
|
||||||
|
|
||||||
for img in self._plot_img:
|
for img in self._plot_img:
|
||||||
self._plot_img[img].remove()
|
try:
|
||||||
|
self._plot_img[img].remove()
|
||||||
|
except Exception as e:
|
||||||
|
logger_exception(e)
|
||||||
|
|
||||||
self._plot_img = {}
|
self._plot_img = {}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user