mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-02 11:12:58 +00:00
fixed: comparison was not using the characterCode
This commit is contained in:
1 parent
f8c7cdfc28
commit
eb1901f03d
1 file changed
+2
-4
@@ -294,10 +294,10 @@ var CPSystemTypesetterFactory,
|
||||
lineRange.length++;
|
||||
measuringRange.length++;
|
||||
|
||||
var currentChar = theString[glyphIndex],
|
||||
var currentCharCode = theString.charCodeAt(glyphIndex), // use pure javascript methods for performance reasons
|
||||
rangeWidth = [theString.substr(measuringRange.location, measuringRange.length) sizeWithFont:_currentFont inWidth:NULL].width + currentAnchor;
|
||||
|
||||
switch (currentChar) // faster than sending actionForControlCharacterAtIndex: called for each char.
|
||||
switch (currentCharCode) // faster than sending actionForControlCharacterAtIndex: called for each char.
|
||||
{
|
||||
case 9: // '\t'
|
||||
{
|
||||
@@ -320,8 +320,6 @@ var CPSystemTypesetterFactory,
|
||||
case 10:
|
||||
case 13:
|
||||
isNewline = YES;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
var advancement = CPMakeSize(rangeWidth - prevRangeWidth, ascent);
|
||||
|
||||
Reference in new issue
Block a user