Render to an image, not a RecordingSurface

This commit is contained in:
XANTRONIX Development 2024-01-09 12:32:05 -05:00
parent 4e14c44266
commit 9f366ef191

View file

@ -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)