Correct the tendancy of the character counter to shift positions/shrink when the message window is resized. Fixes #11898.
authorStephen Holt <sholt@adium.im>
Tue Aug 11 11:14:29 2009 -0400 (2009-08-11)
changeset 2589adafeb783ff9
parent 2588 705099bf70ca
child 2590 34bbe221bb80
Correct the tendancy of the character counter to shift positions/shrink when the message window is resized. Fixes #11898.
Frameworks/Adium Framework/Source/AIMessageEntryTextView.m
     1.1 --- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Tue Aug 11 21:12:55 2009 -0400
     1.2 +++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Tue Aug 11 11:14:29 2009 -0400
     1.3 @@ -1120,11 +1120,12 @@
     1.4  - (void)positionCharacterCounter
     1.5  {
     1.6  	NSRect visRect = [[self superview] bounds];
     1.7 -	NSRect counterRect = [characterCounter frame];
     1.8 +	NSSize counterSize = characterCounter.string.size;
     1.9  	
    1.10  	//NSMaxY([self frame]) is necessary because visRect's height changes after you start typing. No idea why.
    1.11 -	[characterCounter setFrameOrigin:NSMakePoint(NSMaxX(visRect) - NSWidth(counterRect) - INDICATOR_RIGHT_PADDING,
    1.12 -												 NSMidY([self frame]) - NSHeight(counterRect)/2)];
    1.13 +	[characterCounter setFrameOrigin:NSMakePoint(NSMaxX(visRect) - counterSize.width - INDICATOR_RIGHT_PADDING,
    1.14 +												 NSMidY([self frame]) - (counterSize.height)/2)];
    1.15 +	[characterCounter setFrameSize:counterSize];
    1.16  	[[self enclosingScrollView] setNeedsDisplay:YES];
    1.17  }
    1.18