← Back to team overview

kicad-developers team mailing list archive

Re: GerbView GAL: issue with draw order and negative items

 

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@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 



Follow ups

References