feat(ui): macro ui improvement (#473)
* Remove the "Input the text you want to type with this macro action." sentence from the type text macro action. * Move pointer and Scroll enhancement * remove the extra vertical space above the mouse buttons * macro delay enhancement * not allow user select on a few elements * fill the macro, keymap name the all space in the header
This commit is contained in:
committed by
László Monda
parent
bd49e26978
commit
9885439b10
@@ -0,0 +1,17 @@
|
||||
let canvas: HTMLCanvasElement;
|
||||
|
||||
export function getContentWidth(style: CSSStyleDeclaration, text: string): number {
|
||||
if (!text) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!canvas) {
|
||||
canvas = document.createElement('canvas');
|
||||
}
|
||||
|
||||
const context = canvas.getContext('2d');
|
||||
context.font = style.font;
|
||||
const metrics = context.measureText(text);
|
||||
|
||||
return metrics.width;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './html-helper';
|
||||
Reference in New Issue
Block a user