Fixing issue with LocationPickOverlay snap to grid.
This commit is contained in:
parent
51807a80d0
commit
601efc6122
1 changed files with 4 additions and 4 deletions
|
@ -282,10 +282,9 @@ Item {
|
||||||
x: picker.mouseX - width - 5
|
x: picker.mouseX - width - 5
|
||||||
y: picker.mouseY - height - 5
|
y: picker.mouseY - height - 5
|
||||||
color: 'black'
|
color: 'black'
|
||||||
property double axisX: Modules.Canvas.axesStep.x.value
|
|
||||||
property double axisY: Modules.Canvas.axesStep.y.value
|
|
||||||
property double mouseX: {
|
property double mouseX: {
|
||||||
let xpos = Modules.Canvas.px2x(picker.mouseX)
|
const axisX = Modules.Canvas.axesSteps.x.value
|
||||||
|
const xpos = Modules.Canvas.px2x(picker.mouseX)
|
||||||
if(snapToGridCheckbox.checked) {
|
if(snapToGridCheckbox.checked) {
|
||||||
if(canvas.logscalex) {
|
if(canvas.logscalex) {
|
||||||
// Calculate the logged power
|
// Calculate the logged power
|
||||||
|
@ -299,7 +298,8 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
property double mouseY: {
|
property double mouseY: {
|
||||||
let ypos = Modules.Canvas.px2y(picker.mouseY)
|
const axisY = Modules.Canvas.axesSteps.y.value
|
||||||
|
const ypos = Modules.Canvas.px2y(picker.mouseY)
|
||||||
if(snapToGridCheckbox.checked) {
|
if(snapToGridCheckbox.checked) {
|
||||||
return axisY*Math.round(ypos/axisY)
|
return axisY*Math.round(ypos/axisY)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue