I found that line-height can break the script if the line-height is larger than the element size. To work around this (I need to adjust the line height to get the font to center), I set the line-height style to normal then call the script and clear the normal setting after completion.
I am getting inconsistent results on the first execution of a fresh browser window. The same element on first calculation of a fresh browser instance will result in 32px but in later calculations, the correct result of 35px is achieved. I thought this would be because the function does not return fast enough so I tried wrapping it into a promise. Does the script have callbacks perhaps onComplete?
I found that line-height can break the script if the line-height is larger than the element size. To work around this (I need to adjust the line height to get the font to center), I set the line-height style to normal then call the script and clear the normal setting after completion.
I am getting inconsistent results on the first execution of a fresh browser window. The same element on first calculation of a fresh browser instance will result in 32px but in later calculations, the correct result of 35px is achieved. I thought this would be because the function does not return fast enough so I tried wrapping it into a promise. Does the script have callbacks perhaps onComplete?