mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Merge pull request #2139 from evhan55/bugfix/2135
Reverse the sign on Boost Motor A position reporter
This commit is contained in:
commit
6326694bff
1 changed files with 7 additions and 1 deletions
|
@ -1888,7 +1888,13 @@ class Scratch3BoostBlocks {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (portID && this._peripheral.motor(portID)) {
|
if (portID && this._peripheral.motor(portID)) {
|
||||||
return MathUtil.wrapClamp(this._peripheral.motor(portID).position, 0, 360);
|
let val = this._peripheral.motor(portID).position;
|
||||||
|
// Boost motor A position direction is reversed by design
|
||||||
|
// so we have to reverse the position here
|
||||||
|
if (portID === BoostPort.A) {
|
||||||
|
val *= -1;
|
||||||
|
}
|
||||||
|
return MathUtil.wrapClamp(val, 0, 360);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue