From 7142373c2a27737338abb52a4488aa28524c0c2f Mon Sep 17 00:00:00 2001 From: portree_kid Date: Sun, 24 May 2020 11:15:25 +0200 Subject: [PATCH] Heading Edit --- src/renderer/components/ParkingEdit.vue | 24 ++++++++++++++++++++++++ src/renderer/store/modules/Editable.js | 3 +++ 2 files changed, 27 insertions(+) diff --git a/src/renderer/components/ParkingEdit.vue b/src/renderer/components/ParkingEdit.vue index 4fb0acf..b3b42bf 100644 --- a/src/renderer/components/ParkingEdit.vue +++ b/src/renderer/components/ParkingEdit.vue @@ -83,6 +83,14 @@ + + + Heading : + + + + + Parking Type : @@ -207,6 +215,22 @@ this.$parent.$parent.$parent.$refs.editLayer.setPointCoords(this.$store.state.Editable.index, position) } }, + heading: { + // getter + get: function () { + return Number(this.$store.state.Editable.data.parking.heading) + }, + // setter + set: function (newValue) { + if (newValue>=360) { + newValue -= 360 + } + if (newValue<0) { + newValue += 360 + } + this.$store.commit('SET_EDIT_PARKING_HEADING', newValue) + } + }, wingspan: { // getter get: function () { diff --git a/src/renderer/store/modules/Editable.js b/src/renderer/store/modules/Editable.js index 169abe2..44bc0a4 100644 --- a/src/renderer/store/modules/Editable.js +++ b/src/renderer/store/modules/Editable.js @@ -55,6 +55,9 @@ const mutations = { 'SET_EDIT_PARKING_NUMBER' (state, parkingName) { Vue.set(state.data.parking, 'number', parkingName) }, + 'SET_EDIT_PARKING_HEADING' (state, heading) { + Vue.set(state.data.parking, 'heading', heading) + }, 'SET_EDIT_PARKING_AIRLINES' (state, airlineCodes) { Vue.set(state.data.parking, 'airlineCodes', airlineCodes) },