mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-12 21:51:28 +00:00
various fixes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user