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

Group
 
 

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

Submitter:  -Deleted Account- <yjchen>
Submitted:  Tue 27 Jul 2004 03:43:49 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Invalid
Privacy:  Public Assigned to:  alexm
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group Member
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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-09-04 alexm StatusNone Invalid
    Assigned toNone alexm
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code