various fixes

This commit is contained in:
daboe01
2015-07-03 23:13:57 +02:00
parent 6d1d8da101
commit e4c11d9a88
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -24,6 +24,8 @@
@import "CGGeometry.j"
@import "CPPlatformString.j"
@import "CPFont.j"
@import "CPCompatibility.j"
var CPStringSizeWithFontInWidthCache = [],
@@ -71,7 +73,7 @@ CPStringSizeCachingEnabled = YES;
CPStringSizeMeasuringContext.font = [aFont cssString];
var teststring = "0123456879abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.-()";
CPStringSizeIsCanvasSizingInvalid = ABS([CPPlatformString sizeOfString:teststring withFont:aFont forWidth:1000].width - CPStringSizeMeasuringContext.measureText(teststring).width) > 2;
CPStringSizeIsCanvasSizingInvalid = ABS([CPPlatformString sizeOfString:teststring withFont:aFont forWidth:0].width - CPStringSizeMeasuringContext.measureText(teststring).width) > 2;
}
#endif
}
+2 -1
View File
@@ -736,6 +736,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
return;
if ([event charactersIgnoringModifiers].charCodeAt(0) != 229) // filter out 229 because this would be inserted in chrome on each deadkey
[self interpretKeyEvents:[event]];
[_caret setPermanentlyVisible:YES];
}
@@ -1207,7 +1208,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
return;
var nglyphs = [_layoutManager numberOfCharacters],
loc = nglyphs == _selectionRange.location ? MAX(0, _selectionRange.location - 1) : _selectionRange.location;
loc = nglyphs == _selectionRange.location ? MAX(0, _selectionRange.location - 1) : _selectionRange.location,
fragment = [_layoutManager _firstLineFragmentForLineFromLocation:loc];
if (fragment)