Skip to main content
Known Participant
June 1, 2010
Question

ParcelList.getLineSlug seems to be wrongly commented

  • June 1, 2010
  • 1 reply
  • 447 views

I just noticed that ParcelList.getLineSlug() method has an partly incorrect set of comments:

/**Return the width for a line that goes at the current vertical location,
* and could extend down for at least height pixels. Note that this function
* can change the current parcel, and the location within the parcel.
* @param height    amount of contiguous vertical space that must be available
* @param minWidth    amount of contiguous horizontal space that must be available
* @return amount of contiguous horizontal space actually available
*/
public function getLineSlug(slugRect:Rectangle, height:Number, minWidth:Number = 0):Boolean

Could you give us the correct comments and maybe explain the term 'Slug' here. As a non native English speaker it doesn't really give me a clue and my dictionary isn't helpful at all here either .

Further more it says:

Note that this function can change the current parcel, and the location within the parcel.

The 'location' of what within the parcel?

Thanks.

Regards,

Benny

This topic has been closed for replies.

1 reply

Adobe Employee
June 1, 2010

The "Slug" is a term that I think might come from lead type days, and means the space occupied by the line. The purpose of the ParcelList is to abstract the management of the geometry of the text from the composer.A ParcelList manages a list of rectangles through which text may flow. Each rectangle is a Parcel. The intent is that (eventually) there could be a more complex  implementation of ParcelList that can handle more than just simple  rectangles. For now, it is just rectangles. Most commonly, just one rectangle, especially if you are using TLF with Flex, but it is possible to have multiple if the IFlowComposer has more than one controller. The getLineSlug function's main purpose is to find a place for the next line, based on the current parcel and the "depth" or position within the parcel (i.e., how much text has already been layed out in the parcel. The comment refers to a more flexible design than what was actually implemented, with the idea that getLineSlug might find a slug in a next parcel, or might find a slug that is not at the current depth. I don't think the code will actually advance to the next parcel, this was just part of the flexibility that was designed in.

- robin