1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 08:15:22 +03:00

Merge pull request #1186 from mikeller/fix_rates_exception

Fixed exception when rates curve not showing.
This commit is contained in:
Michael Keller 2018-09-01 12:50:24 +12:00 committed by GitHub
commit fd65c6a4f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1497,15 +1497,12 @@ TABS.pid_tuning.updateRatesLabels = function() {
yaw : {color: 'rgba(128,128,255,0.4)', border: 'rgba(128,128,255,0.6)', text: '#000000'} yaw : {color: 'rgba(128,128,255,0.4)', border: 'rgba(128,128,255,0.6)', text: '#000000'}
}; };
var rcStickElement, var rcStickElement = $('.rate_curve canvas#rate_curve_layer1').get(0);
stickContext; if(rcStickElement) {
if(!rcStickElement) {
rcStickElement = $('.rate_curve canvas#rate_curve_layer1').get(0);
rcStickElement.width = 1000; rcStickElement.width = 1000;
rcStickElement.height = 1000; rcStickElement.height = 1000;
}
if(!stickContext) stickContext = rcStickElement.getContext("2d"); var stickContext = rcStickElement.getContext("2d");
stickContext.save(); stickContext.save();
@ -1572,6 +1569,6 @@ TABS.pid_tuning.updateRatesLabels = function() {
for(var i=0; i<balloons.length; i++) balloons[i].balloon(); for(var i=0; i<balloons.length; i++) balloons[i].balloon();
stickContext.restore(); stickContext.restore();
}
} }
}; };