Logo Search packages:      
Sourcecode: rosegarden version File versions

virtual void NotationStaff::positionElements ( Rosegarden::timeT  from,
Rosegarden::timeT  to 
) [virtual]

Assign suitable coordinates to the elements on the staff, based entirely on the layout X and Y coordinates they were given by the horizontal and vertical layout processes.

This is necessary because the sprites that are being positioned may have been created either after the layout process completed (by renderElements) or before (by the previous renderElements call, if the sprites are unchanged but have moved) -- so neither the layout nor renderElements can authoritatively set their final positions.

This method also updates the selected-ness of any elements it sees (i.e. it turns the selected ones blue and the unselected ones black), and re-generates sprites for any elements for which it seems necessary. In general it will only notice a element needs regenerating if its position has changed, not if the nature of the element has changed, so this is no substitute for calling renderElements.

The from and to arguments are used to indicate the extents of a changed area within the staff. The actual area within which the elements end up being repositioned will begin at the start of the bar containing the changed area's start, and will end at the start of the next bar whose first element hasn't moved, after the changed area's end.

Call this after renderElements, or after changing the selection, passing from and to arguments corresponding to the times of those passed to renderElements.

Implements LinedStaff.

Generated by  Doxygen 1.6.0   Back to index