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

Merge pull request #287 from nathantsoi/fix/osd-logo

logo first, so it is overwritten by other fields in the preview
This commit is contained in:
borisbstyle 2016-09-19 07:15:09 +02:00 committed by GitHub
commit a0d85cc11e

View file

@ -500,6 +500,12 @@ TABS.osd.initialize = function (callback) {
for(var i = 0; i < OSD.data.display_size.total; i++) { for(var i = 0; i < OSD.data.display_size.total; i++) {
OSD.data.preview.push([null, ' '.charCodeAt(0)]); OSD.data.preview.push([null, ' '.charCodeAt(0)]);
} }
// logo first, so it gets overwritten by subsequent elements
var x = 160;
for (var i = 1; i < 5; i++) {
for (var j = 3; j < 27; j++)
OSD.data.preview[i * 30 + j] = [{name: 'LOGO', positionable: false}, x++];
}
// draw all the displayed items and the drag and drop preview images // draw all the displayed items and the drag and drop preview images
for(let field of OSD.data.display_items) { for(let field of OSD.data.display_items) {
if (!field.preview || field.position == -1) { continue; } if (!field.preview || field.position == -1) { continue; }
@ -519,12 +525,6 @@ TABS.osd.initialize = function (callback) {
} }
field.preview_img.src = canvas.toDataURL('image/png'); field.preview_img.src = canvas.toDataURL('image/png');
} }
// logo
var x = 160;
for (var i = 1; i < 5; i++) {
for (var j = 3; j < 27; j++)
OSD.data.preview[i * 30 + j] = [{name: 'LOGO', positionable: false}, x++];
}
var centerishPosition = 194; var centerishPosition = 194;
// artificial horizon // artificial horizon
if ($('input[name="ARTIFICIAL_HORIZON"]').prop('checked')) { if ($('input[name="ARTIFICIAL_HORIZON"]').prop('checked')) {