Skip to content

Commit 29c7060

Browse files
committed
Support flipx and flipy
1 parent 4689b51 commit 29c7060

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"vite": "^4.4.5"
3232
},
3333
"dependencies": {
34-
"@abstractplay/renderer": "^1.0.0-ci-21051058249.0",
34+
"@abstractplay/renderer": "latest",
3535
"@types/html2canvas": "^0.5.35",
3636
"@zerodevx/svelte-toast": "^0.9.6",
3737
"gif.js.optimized": "^1.0.1",

src/components/Pieces.svelte

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,20 @@
126126
glyphObj = glyphObj;
127127
};
128128
129+
let flipx = false;
130+
const handleFlipXChange = () => {
131+
flipx = !flipx;
132+
glyphObj.flipx = flipx;
133+
glyphObj = glyphObj;
134+
};
135+
136+
let flipy = false;
137+
const handleFlipYChange = () => {
138+
flipy = !flipy;
139+
glyphObj.flipy = flipy;
140+
glyphObj = glyphObj;
141+
};
142+
129143
const addToLegend = () => {
130144
const id = nanoid();
131145
if (
@@ -207,6 +221,24 @@
207221
/>
208222
</div>
209223
</div>
224+
<div class="field">
225+
<label class="checkbox">
226+
<input
227+
type="checkbox"
228+
bind:checked="{flipx}"
229+
on:input="{handleFlipXChange}"
230+
/>
231+
Flip x coordinates
232+
</label>
233+
<label class="checkbox">
234+
<input
235+
type="checkbox"
236+
bind:checked="{flipy}"
237+
on:input="{handleFlipYChange}"
238+
/>
239+
Flip y coordinates
240+
</label>
241+
</div>
210242
<div class="field">
211243
<label class="label" for="addOverlay">Overlay text</label>
212244
<div class="control">

0 commit comments

Comments
 (0)