Set clipping region to snip isotherms

This commit is contained in:
XANTRONIX 2025-02-24 00:21:19 -05:00
parent 2fbf648ce6
commit 60158d6f55

View file

@ -68,7 +68,7 @@ class SkewT():
return self.skew_t_to_graph(x, y)
def draw_isotherms(self, cr: cairo.Context, x: float, y: float):
cr.set_source_rgb(0.99, 0.99, 0.99)
cr.set_source_rgb(0.95, 0.95, 0.95)
for temp in range(-150, TEMP_MAX+1, TEMP_STEP):
x1, y1 = self.graph_to_screen(*self.sample_to_graph(temp, PRESSURE_MAX))
@ -115,6 +115,9 @@ class SkewT():
x: float,
y: float,
samples: Iterable[SoundingSample]):
cr.rectangle(x, y, self.width, self.height)
cr.clip()
self.draw_isotherms(cr, x, y)
self.draw_isobars(cr, x, y)