I am trying to center the text in a box, but You accidentally use the string There is only one argument in the measurement text and you are giving it two. It should only be Here it is in jsfiddle: ctx.measureText () Not returning the exact value when the code is run down, the text is not centered correctly. It runs under Google Chrome for me, but I could not find it to run under jsfiddle (sorry)
instead of
font Text every time!
width = ctx.measureText (text). Wide;
Comments
Post a Comment