configurable refresh rate for 2d CA

This commit is contained in:
Gator
2022-01-10 20:49:09 +01:00
parent 980be551c1
commit 6f1e813316
3 changed files with 30 additions and 3 deletions

View File

@ -22,6 +22,20 @@
@input="updateCanvasHeight"
>
</div>
<div class="form-field">
<label for="live">Refresh Rate (ms)</label>
</div>
<div class="form-field">
<input
id="refreshRate"
name="refreshRate"
type="number"
min="100"
step="100"
:value="refreshRate"
@input="updateRefreshRate"
>
</div>
</form>
</MenuRow>
</template>
@ -37,7 +51,8 @@ export default {
computed: {
...mapGetters({
canvasWidth: 'getCanvasWidth',
canvasHeight: 'getCanvasHeight'
canvasHeight: 'getCanvasHeight',
refreshRate: 'getRefreshRate'
})
},
methods: {
@ -48,6 +63,10 @@ export default {
updateCanvasWidth: function(event) {
const elem = event.target
this.$store.commit('setCanvasWidth', elem.value)
},
updateRefreshRate: function(event) {
const elem = event.target
this.$store.commit('setRefreshRate', elem.value)
}
}
}