Skip to content

Commit

Permalink
Update pid_tuning.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRosser committed Apr 6, 2024
1 parent 4ae25ab commit 3ca0909
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/js/tabs/pid_tuning.js
Original file line number Diff line number Diff line change
Expand Up @@ -1781,20 +1781,20 @@ pid_tuning.initialize = function (callback) {
context.beginPath();
context.moveTo(0, canvasHeight);
if (throttleLimitType === THROTTLE_LIMIT_TYPES.CLIP){
const clippos = throttleLimitPercent <= midy
const clipPos = throttleLimitPercent <= midy
? getPosfromYBezier(throttleLimitPercent,canvasHeight,midyl, midy)
: getPosfromYBezier(throttleLimitPercent,midy, midyl, 0);
let lowerctrl = getQuadraticCurvePoint(0, canvasHeight, midxl, midyl, midx, midy, clippos / 2);
let curveclip = getQuadraticCurvePoint(0, canvasHeight, midxl, midyl, midx, midy, clippos);
let lowerCtrl = getQuadraticCurvePoint(0, canvasHeight, midxl, midyl, midx, midy, clipPos / 2);
let curveClip = getQuadraticCurvePoint(0, canvasHeight, midxl, midyl, midx, midy, clipPos);
if (throttleLimitPercent > midyl){
context.quadraticCurveTo(midxl, midyl, midx, midy);
context.moveTo(midx, midy);
lowerctrl = getQuadraticCurvePoint(midx, midy, midxr, midyr, canvasWidth, 0, clippos / 2);
curveclip = getQuadraticCurvePoint(midx, midy, midxr, midyr, canvasWidth, 0, clippos);
lowerCtrl = getQuadraticCurvePoint(midx, midy, midxr, midyr, canvasWidth, 0, clipPos / 2);
curveClip = getQuadraticCurvePoint(midx, midy, midxr, midyr, canvasWidth, 0, clipPos);
}
context.quadraticCurveTo(lowerctrl.x, lowerctrl.y, curveclip.x, curveclip.y);
context.moveTo(curveclip.x, curveclip.y);
context.lineTo(canvasWidth, curveclip.y);
context.quadraticCurveTo(lowerCtrl.x, lowerCtrl.y, curveClip.x, curveClip.y);
context.moveTo(curveClip.x, curveClip.y);
context.lineTo(canvasWidth, curveClip.y);
} else {
context.quadraticCurveTo(midxl, midyl, midx, midy);
context.moveTo(midx, midy);
Expand Down

0 comments on commit 3ca0909

Please sign in to comment.