option to change drawing direction

This commit is contained in:
Gator
2022-01-13 18:07:41 +01:00
parent f41e415b32
commit 980cdc35a2
4 changed files with 38 additions and 9 deletions

View File

@ -40,6 +40,16 @@
@input="updateRefreshRate"
>
</div>
<div class="form-field">
<label>Invert Drawing Direction
<input
type="checkbox"
:checked="drawingDirection === 'x'"
:value="drawingDirection"
@input="updateDrawingDirection"
>
</label>
</div>
</form>
</MenuRow>
</template>
@ -56,7 +66,8 @@ export default {
...mapGetters({
canvasWidth: 'getCanvasWidth',
canvasHeight: 'getCanvasHeight',
refreshRate: 'getRefreshRate'
refreshRate: 'getRefreshRate',
drawingDirection: 'getDrawingDirection'
})
},
methods: {
@ -71,6 +82,12 @@ export default {
updateRefreshRate: function(event) {
const elem = event.target
this.$store.commit('setRefreshRate', elem.value)
},
updateDrawingDirection: function(event) {
const elem = event.target
const value = elem.checked ? "x" : "y"
this.$store.commit('setDrawingDirection', value)
console.log(this.drawingDirection)
}
}
}