[webkit-changes] cvs commit: WebCore/kwq KWQTextArea.mm
Beth
bdakin at opensource.apple.com
Wed Dec 14 14:16:17 PST 2005
bdakin 05/12/14 14:16:17
Modified: . ChangeLog
kwq KWQTextArea.mm
Log:
Bug #:
Revision Changes Path
1.530 +17 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.529
retrieving revision 1.530
diff -u -r1.529 -r1.530
--- ChangeLog 14 Dec 2005 18:45:58 -0000 1.529
+++ ChangeLog 14 Dec 2005 22:16:15 -0000 1.530
@@ -1,3 +1,20 @@
+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-14 Mitz Pettel <opendarwin.org at mitzpettel.com>
Reviewed by Darin & Geoff, committed by Adele.
1.98 +6 -4 WebCore/kwq/KWQTextArea.mm
Index: KWQTextArea.mm
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQTextArea.mm,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- KWQTextArea.mm 28 Oct 2005 17:35:43 -0000 1.97
+++ KWQTextArea.mm 14 Dec 2005 22:16:17 -0000 1.98
@@ -68,7 +68,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)
@@ -547,7 +547,7 @@
NSParagraphStyle *style = [textView _KWQ_typingParagraphStyle];
if (_lineHeight) {
ASSERT(style);
- [textView _KWQ_updateTypingAttributes:style forLineHeight:_lineHeight fontHeight:([_font ascender] - [_font descender])];
+ [textView _KWQ_updateTypingAttributes:style forLineHeight:_lineHeight font:_font];
}
}
@@ -594,7 +594,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];
}
@@ -1287,11 +1287,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) ? floor(h) : -floor(-h);
if (typingAttrs)
dict = [typingAttrs mutableCopy];
More information about the webkit-changes
mailing list