adium 2589:adafeb783ff9: Correct the tendancy of the character c...

commits at adium.im commits at adium.im
Wed Aug 12 02:38:27 UTC 2009


details:	http://hg.adium.im/adium/rev/adafeb783ff9
revision:	2589:adafeb783ff9
author:		Stephen Holt <sholt at adium.im>
date:		Tue Aug 11 11:14:29 2009 -0400

Correct the tendancy of the character counter to shift positions/shrink when the message window is resized. Fixes #11898.

diffs (19 lines):

diff -r 705099bf70ca -r adafeb783ff9 Frameworks/Adium Framework/Source/AIMessageEntryTextView.m
--- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Tue Aug 11 21:12:55 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Tue Aug 11 11:14:29 2009 -0400
@@ -1120,11 +1120,12 @@
 - (void)positionCharacterCounter
 {
 	NSRect visRect = [[self superview] bounds];
-	NSRect counterRect = [characterCounter frame];
+	NSSize counterSize = characterCounter.string.size;
 	
 	//NSMaxY([self frame]) is necessary because visRect's height changes after you start typing. No idea why.
-	[characterCounter setFrameOrigin:NSMakePoint(NSMaxX(visRect) - NSWidth(counterRect) - INDICATOR_RIGHT_PADDING,
-												 NSMidY([self frame]) - NSHeight(counterRect)/2)];
+	[characterCounter setFrameOrigin:NSMakePoint(NSMaxX(visRect) - counterSize.width - INDICATOR_RIGHT_PADDING,
+												 NSMidY([self frame]) - (counterSize.height)/2)];
+	[characterCounter setFrameSize:counterSize];
 	[[self enclosingScrollView] setNeedsDisplay:YES];
 }
 




More information about the commits mailing list