From 9f366ef191c4a0d006f10ca2031c434d0cd50e54 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Tue, 9 Jan 2024 12:32:05 -0500 Subject: [PATCH] Render to an image, not a RecordingSurface --- py/hexagram/pattern.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/hexagram/pattern.py b/py/hexagram/pattern.py index 24b2397..e18a43c 100644 --- a/py/hexagram/pattern.py +++ b/py/hexagram/pattern.py @@ -58,9 +58,9 @@ class HexagonPattern(Pattern): def __init__(self): super().__init__(self.COMMANDS) - def to_surface(self) -> cairo.RecordingSurface: + def to_surface(self) -> cairo.ImageSurface: rect = cairo.Rectangle(0, 0, self.WIDTH, self.HEIGHT) - surface = cairo.RecordingSurface(cairo.Content.COLOR_ALPHA, rect) + surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, self.WIDTH, self.HEIGHT) cr = cairo.Context(surface) cr.set_source_rgb(*self.COLOR)