bugGNUstep - Bugs: bug #9789, - cellFrameForText... in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9789: - cellFrameForText... in NSTextAttachmentCell is called recursively

Submitted by:  -Deleted Account- <yjchen>
Submitted on:  Tue 27 Jul 2004 03:43:49 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Invalid
Privacy: PublicAssigned to: Alexander Malmberg <alexm>
Open/Closed: Closed

Sat 04 Sep 2004 09:46:56 PM UTC, comment #2:

-gui is correct here. The rectangle returned from -cellFrameForTextContainer:... is relative to the current position, and this will be on the baseline, which implies that it's above the bottom of the line frag. To get a cell that is as tall as the line frag, you need to place its origin at the bottom of the line frag. In the example, you want:

return NSMakeRect(0, -p.y, lf.size.width-10, lf.size.height);

Unfortunately, there used to be a bug that would cause an incorrect current position to be passed, but this is fixed in cvs 2004-09-04. I've also clarified the NSTextAttachmentCell documentation about this.

Alexander Malmberg <alexm>
Project MemberIn charge of this item.
Tue 27 Jul 2004 03:46:31 PM UTC, comment #1:

I should say this method is called "repeatly" not "recursively".

-Deleted Account- <yjchen>
Tue 27 Jul 2004 03:43:49 PM UTC, original submission:

If a subclass of NSTextAttachmentCell returns
-cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:
with a height of NSRect which is exactly the same as the height of the proposedLineFragment,
this method will be called recursively and the height of proposedLineFragment keep increasing.

An example looks like this:

- (NSRect) cellFrameForTextContainer: (NSTextContainer *)c
proposedLineFragment: (NSRect) lf
glyphPosition: (NSPoint) p
characterIndex: (unsigned int) ci
{
return NSMakeRect(0, 0, lf.size.width-10, lf.size.height);
}

It can be verified in HelpViewer.app by changing the return NSRect in HRCell.m

-Deleted Account- <yjchen>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 04 Sep 2004 09:46:56 PM UTCalexmStatusNone=>Invalid
  Assigned toNone=>alexm
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1