Hi Tom, Thanks very much for the suggestions, I will look in to doing it this way.
Hi Chris, as you might tell from Tom's response, the existing tree does not keep track of insertion order and draw priority, but I will take the approach of adding that feature. I have a sample of a board with Gerber files for several layers that use negative draw mode. Since the goal is to have GerbView use GAL without losing any features from the existing (legacy) draw code, it must support negative objects, even if they are rare. In fact, they are implemented currently as drawing the background color, as you suggest. Best, Jon On Mon, Feb 27, 2017 at 6:10 AM, Tomasz Wlostowski < tomasz.wlostow...@cern.ch> wrote: > On 26.02.2017 20:49, Jon Evans wrote: > > Hi all, > > > > I've run into a problem while porting GerbView to GAL that doesn't have > > (...) > > Another would be to implement some sort of render order sorting inside > > VIEW, but I haven't looked in to that much yet, so I'm not sure how > > complicated it would be. > > > > Does anyone have suggestions for this problem? > > Hi Jon, > > Many thanks for your excellent work. > > One of possible ways to solve your problem is to: > - Add an additional field (say, m_drawPriority) in VIEW_ITEM_DATA > containing the drawing priority > - Modify VIEW::redrawRect() and VIEW::drawItem to first collect all > drawable items, sort them by m_drawPriority and then draw. > - The m_drawPriority could be accessed by additional methods in the VIEW > class and by default initialized to subsequent values as items are added > to a VIEW. > - Sorting could be optional, for large PCB views it might affect > performance. > > Cheers, > Tom > > PS. If you have time, feel free to C++11-ize the VIEW code ;-) > > > > > > > Thanks, > > Jon > > > > > > _______________________________________________ > > Mailing list: https://launchpad.net/~kicad-developers > > Post to : kicad-developers@lists.launchpad.net > > Unsubscribe : https://launchpad.net/~kicad-developers > > More help : https://help.launchpad.net/ListHelp > > > >
_______________________________________________ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp