Fixing review nits; moving small functions inside bidi

This commit is contained in:
notmasteryet 2012-02-22 17:56:47 -06:00
parent 31d8d13ba2
commit e8ca7b44d9
2 changed files with 96 additions and 94 deletions

View file

@ -779,15 +779,15 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
x += charWidth;
var glyphUnicode = glyph.unicode === ' ' ? '\u00A0' : glyph.unicode;
var glyphUniLen = glyphUnicode.length;
var glyphUnicodeLength = glyphUnicode.length;
//reverse an arabic ligature
if (glyphUniLen > 1 && isRTLRangeFor(glyphUnicode.charCodeAt(0)))
{
for (var ii = glyphUniLen - 1; ii >= 0; ii--)
if (glyphUnicodeLength > 1 &&
isRTLRangeFor(glyphUnicode.charCodeAt(0))) {
for (var ii = glyphUnicodeLength - 1; ii >= 0; ii--)
text.str += glyphUnicode[ii];
} else
text.str += glyphUnicode;
text.length += glyphUniLen;
text.length += glyphUnicodeLength;
text.canvasWidth += charWidth;
}
current.x += x * textHScale2;