Skip to content

Commit

Permalink
fix: electrode offset error
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangChiTW committed Oct 7, 2022
1 parent be81a68 commit a44c177
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/store/actions/projectAct.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import api from '@/api'

const generateEWD = function (state) {
const scale = (80000 / 8000)
const gapSize = state.project.gapSize * scale
let electrods = state.project.pages[0].children

let dataElectrode = ''
Expand Down Expand Up @@ -59,7 +60,7 @@ const generateEWD = function (state) {
electrods.forEach(getPos)

function getPos (item, index) {
dataElectrode = dataElectrode + item.name + ' ' + (parseFloat(item.left) * scale + 1000 - 1630 + 15) + ' ' + (parseFloat(item.top) * scale + 12258 + 15) + '\n'
dataElectrode = dataElectrode + item.name + ' ' + (parseFloat(item.left) * scale + 1000 - 1630 + gapSize / 2) + ' ' + (parseFloat(item.top) * scale + 12258 + (gapSize / 2)) + '\n'
}

dataElectrode = dataElectrode + '#ENDOFLAYOUT#\n'
Expand Down

0 comments on commit a44c177

Please sign in to comment.