Skip to content

Commit da01629

Browse files
committed
Adust SVG loading code to agree with skia-python - Copilot made things up again!
1 parent 9b9e922 commit da01629

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

SkiaGTK4_SuperAdvancedGL.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ def create_svg_picture(self):
119119
import os
120120
svg_path = os.path.join(os.path.dirname(__file__), "skia-logo.svg")
121121
if os.path.exists(svg_path):
122-
self.svg_picture = skia.SVGDOM.MakeFromFile(svg_path).getPicture()
122+
svgstream = skia.Stream.MakeFromFile(svg_path)
123+
self.svg_picture = skia.SVGDOM.MakeFromStream(svgstream)
123124
except Exception as e:
124125
self.svg_picture = None
125126

@@ -249,8 +250,9 @@ def on_render(self, area, gl_context):
249250
# Draw SVG if available
250251
if self.svg_picture:
251252
canvas.save()
252-
canvas.scale(0.2, 0.2)
253-
canvas.drawPicture(self.svg_picture)
253+
canvas.translate(width * 0.1, height * 0.1)
254+
canvas.scale(0.4, 0.4)
255+
self.svg_picture.render(canvas)
254256
canvas.restore()
255257

256258
# Draw text on path (circle)

0 commit comments

Comments
 (0)