Geometry: fix error on the first right click in the profile plot (water limits not yet cached)

This commit is contained in:
Dylan Jeannin committed 2026-10-26 10:57:29 +01:00
1 parent d8d1b4cd1f
commit a4eee962f7
1 file changed
+6 -1
+6 -1
View File
@@ -17,6 +17,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import queue import queue
import types
import random import random
import logging import logging
import numpy as np import numpy as np
@@ -806,7 +807,11 @@ class ProfileXYZ(Profile, SQLSubModel):
return poly return poly
def wet_points(self, z): def wet_points(self, z):
left, right = self.get_water_limits(z) limits = self.get_water_limits(z)
if isinstance(limits, types.GeneratorType):
limits = next(limits)
left, right = limits
points = list(filter(lambda p: p.z < z, self._points)) points = list(filter(lambda p: p.z < z, self._points))
points = [left] + points + [right] points = [left] + points + [right]