mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 08:15:22 +03:00
Adjust Modes Name CSS min-width
This commit is contained in:
parent
5ed5d04831
commit
1b26bb5dcc
4 changed files with 14 additions and 11 deletions
|
@ -85,9 +85,19 @@ export function getMixerImageSrc(mixerIndex, reverseMotorDir, apiVersion)
|
|||
return `./resources/motor_order/${mixerList[mixerIndex - 1].image}${reverse}.svg`;
|
||||
}
|
||||
|
||||
export function getTextWidth(text) {
|
||||
const canvas = document.createElement('canvas');
|
||||
const context = canvas.getContext('2d');
|
||||
|
||||
context.font = getComputedStyle(document.body).font;
|
||||
|
||||
return Math.ceil(context.measureText(text).width);
|
||||
}
|
||||
|
||||
// TODO: these are temp binding while transition to module happens
|
||||
window.degToRad = degToRad;
|
||||
window.bytesToSize = bytesToSize;
|
||||
window.checkChromeRuntimeError = checkChromeRuntimeError;
|
||||
window.generateVirtualApiVersions = generateVirtualApiVersions;
|
||||
window.getMixerImageSrc = getMixerImageSrc;
|
||||
window.getTextWidth = getTextWidth;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue