X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=emcclib.js;h=385281ad0b6778e0120a554c86e827de9f18aa04;hb=3ce69e84cad15844282d691fa03e711c5353c05e;hp=7d001c3f852c4de5bbf0c5c098aab192885701b4;hpb=c0fff857fd910eb4af7eabd6ad08da554f694f43;p=sgt-puzzles.git diff --git a/emcclib.js b/emcclib.js index 7d001c3..385281a 100644 --- a/emcclib.js +++ b/emcclib.js @@ -412,7 +412,7 @@ mergeInto(LibraryManager.library, { // Find the width of the string var ctx1 = onscreen_canvas.getContext('2d'); ctx1.font = font; - var width = ctx1.measureText(midpoint_test_str).width; + var width = (ctx1.measureText(midpoint_test_str).width + 1) | 0; // Construct a test canvas of appropriate size, initialise it to // black, and draw the string on it in white