-
Notifications
You must be signed in to change notification settings - Fork 243
Description
I have run into an issue while designing a track that uses autoHeight. I have implemented a packing function that, in addition to the features, depends on having the bpPerPixel and graphics context (for calculating text measurements). I assumed that I would simply call my packing routine from implementations of getFeatures() or computeTrackHeight(), however neither of these function signatures provide the graphic context, and computeTrackHeight() doesn't provide bpPerPixel. I was forced to use the standard computeTrackHeight (MAX(row)+1), and place my packing call in draw(). The side-effect being, in the initial load of the browser computeTrackHeight() is called before draw() and the track height is calculated from un-initialized row assignments.
I wonder if there is preferred design for tracks that need to perform a height calculation based on scale and text measurements?