[webkit-changes] cvs commit: WebCore/kwq KWQTextArea.mm
Timothy
thatcher at opensource.apple.com
Wed Dec 14 14:45:24 PST 2005
thatcher 05/12/14 14:45:24
Modified: . Tag: Safari-1-3-branch ChangeLog
kwq Tag: Safari-1-3-branch KWQTextArea.mm
Log:
Merged fix from TOT to Safari-1-3-branch
2005-12-14 Beth Dakin <bdakin at apple.com>
Reviewed by Eric.
Fix for <rdar://problem/4374783> 10.4.4 REGRESSION: caret
disappears when typing at the bottom of a scrollable textarea.
This regression occurred because we were calculating the font
height incorrectly. Made changes that Doug suggested in the bug.
* kwq/KWQTextArea.mm:
(-[KWQTextAreaTextView setFont:]): Send the font itself to
_KWQ_updateTypingAttributes
(-[KWQTextAreaTextView setLineHeight:]): Same.
(-[NSTextView _KWQ_updateTypingAttributes:forLineHeight:font:]):
Calculate the font height using defaultLineHeightForFont.
Revision Changes Path
No revision
No revision
1.335.2.55 +21 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.335.2.54
retrieving revision 1.335.2.55
diff -u -r1.335.2.54 -r1.335.2.55
--- ChangeLog 13 Dec 2005 00:21:18 -0000 1.335.2.54
+++ ChangeLog 14 Dec 2005 22:45:19 -0000 1.335.2.55
@@ -1,3 +1,24 @@
+2005-12-14 Timothy Hatcher <timothy at apple.com>
+
+ Merged fix from TOT to Safari-1-3-branch
+
+ 2005-12-14 Beth Dakin <bdakin at apple.com>
+
+ Reviewed by Eric.
+
+ Fix for <rdar://problem/4374783> 10.4.4 REGRESSION: caret
+ disappears when typing at the bottom of a scrollable textarea.
+
+ This regression occurred because we were calculating the font
+ height incorrectly. Made changes that Doug suggested in the bug.
+
+ * kwq/KWQTextArea.mm:
+ (-[KWQTextAreaTextView setFont:]): Send the font itself to
+ _KWQ_updateTypingAttributes
+ (-[KWQTextAreaTextView setLineHeight:]): Same.
+ (-[NSTextView _KWQ_updateTypingAttributes:forLineHeight:font:]):
+ Calculate the font height using defaultLineHeightForFont.
+
2005-12-12 Timothy Hatcher <timothy at apple.com>
Merged fix from TOT to Safari-1-3-branch
No revision
No revision
1.72.6.7 +6 -4 WebCore/kwq/KWQTextArea.mm
Index: KWQTextArea.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQTextArea.mm,v
retrieving revision 1.72.6.6
retrieving revision 1.72.6.7
diff -u -r1.72.6.6 -r1.72.6.7
--- KWQTextArea.mm 1 Dec 2005 23:55:39 -0000 1.72.6.6
+++ KWQTextArea.mm 14 Dec 2005 22:45:23 -0000 1.72.6.7
@@ -61,7 +61,7 @@
@interface NSTextView (KWQTextArea)
- (NSParagraphStyle *)_KWQ_typingParagraphStyle;
- (void)_KWQ_setTypingParagraphStyle:(NSParagraphStyle *)style;
-- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight fontHeight:(float)fontHeight;
+- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight font:(NSFont *)font;
@end
@interface NSTextStorage (KWQTextArea)
@@ -442,7 +442,7 @@
NSParagraphStyle *style = [textView _KWQ_typingParagraphStyle];
if (_lineHeight) {
- [textView _KWQ_updateTypingAttributes:style forLineHeight:_lineHeight fontHeight:([_font ascender] - [_font descender])];
+ [textView _KWQ_updateTypingAttributes:style forLineHeight:_lineHeight font:_font];
}
}
@@ -490,7 +490,7 @@
}
NSMutableParagraphStyle *newStyle = [paraStyle mutableCopy];
[newStyle setMinimumLineHeight:lineHeight];
- [textView _KWQ_updateTypingAttributes:newStyle forLineHeight:lineHeight fontHeight:([_font ascender] - [_font descender])];
+ [textView _KWQ_updateTypingAttributes:newStyle forLineHeight:lineHeight font:_font];
[newStyle release];
}
@@ -1008,11 +1008,13 @@
[attributes release];
}
-- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight fontHeight:(float)fontHeight
+- (void)_KWQ_updateTypingAttributes:(NSParagraphStyle *)style forLineHeight:(float)lineHeight font:(NSFont *)font
{
NSDictionary *typingAttrs = [self typingAttributes];
NSMutableDictionary *dict;
+ float fontHeight = [[self layoutManager] defaultLineHeightForFont:font];
float h = (lineHeight / 2.0f) - (fontHeight / 2.0f);
+ h = (h >= 0.0) ? floorf(h) : -floorf(-h);
if (typingAttrs)
dict = [typingAttrs mutableCopy];
More information about the webkit-changes
mailing list