mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
Fixed: make travis happy with DOM elements in CPTextView
This commit is contained in:
1 parent
a884b94ac0
commit
4ebcf40619
2 files changed
+13
-5
No files matched your search
@@ -285,10 +285,12 @@ _oncontextmenuhandler = function () { return false; };
|
||||
// We erased all lines
|
||||
if (!startIndex)
|
||||
[self setExtraLineFragmentRect:CGRectMake(0, 0) usedRect:CGRectMake(0, 0) textContainer:nil];
|
||||
|
||||
// document.title=startIndex;
|
||||
|
||||
[_typesetter layoutGlyphsInLayoutManager:self startingAtGlyphIndex:startIndex maxNumberOfLineFragments:-1 nextGlyphIndex:nil];
|
||||
#if PLATFORM(DOM)
|
||||
[self _cleanUpDOM];
|
||||
#endif
|
||||
_isValidatingLayoutAndGlyphs = NO;
|
||||
}
|
||||
|
||||
|
||||
@@ -345,8 +345,15 @@ var CPSystemTypesetterFactory;
|
||||
lineRange.length++;
|
||||
measuringRange.length++;
|
||||
|
||||
var currentChar = theString[glyphIndex], // use pure javascript methods for performance reasons
|
||||
rangeWidth = _widthOfStringForFont(theString.substr(measuringRange.location, measuringRange.length), _currentFont).width + currentAnchor;
|
||||
|
||||
var currentChar = theString[glyphIndex];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
// use pure javascript methods for performance reasons -> why don't we use sizeWithFont ?
|
||||
var rangeWidth = _widthOfStringForFont(theString.substr(measuringRange.location, measuringRange.length), _currentFont).width + currentAnchor;
|
||||
#else
|
||||
var rangeWidth = [theString.substr(measuringRange.location, measuringRange.length) sizeWithFont:_currentFont].width + currentAnchor;
|
||||
#endif
|
||||
|
||||
switch (currentChar) // faster than sending actionForControlCharacterAtIndex: called for each char.
|
||||
{
|
||||
@@ -365,11 +372,10 @@ var CPSystemTypesetterFactory;
|
||||
wrapRange = CPMakeRangeCopy(lineRange);
|
||||
wrapWidth = rangeWidth;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (_isNewlineCharacter(currentChar))
|
||||
{
|
||||
isNewline = YES;
|
||||
}
|
||||
}
|
||||
|
||||
advancements.push(rangeWidth - prevRangeWidth);
|
||||
|
||||
Reference in new issue
Block a user