Handle opacity on canvas instead of dom

This commit is contained in:
Andreas Hocevar
2022-07-10 15:30:28 +02:00
parent 239487e9f0
commit 6086459cba
7 changed files with 76 additions and 58 deletions
-8
View File
@@ -114,11 +114,3 @@ export const getFontParameters = function (fontSpec) {
style.families = style.family.split(/,\s?/);
return style;
};
/**
* @param {number} opacity Opacity (0..1).
* @return {string} CSS opacity.
*/
export function cssOpacity(opacity) {
return opacity === 1 ? '' : String(Math.round(opacity * 100) / 100);
}