Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions site/plugins/pixels/snippets/canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class="canvas-headline"
:data-x="settings.position.x"
:src="settings.image"
:style="{ width: settings.scale + '%' }"
decoding="sync"
>
</div>
</template>
Expand Down
6 changes: 6 additions & 0 deletions site/plugins/pixels/snippets/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@
const zoom = this.settings.zoom;
this.settings.zoom = 1;
const link = document.createElement("a");

// stupid workaround fix for Safari, calling toPng multiple times
// https://github.com/bubkoo/html-to-image/issues/361
await toPng(canvas);
await toPng(canvas);
link.href = await toPng(canvas);

link.download = "pixels.png";
link.click();
this.settings.zoom = zoom;
Expand Down