← Back to team overview

kicad-developers team mailing list archive

Re: Questions on BOARD_COMMIT

 

Hi Wayne,

On 11/29/2017 06:35 PM, Wayne Stambaugh wrote:
[snip]>> KIGFX::VIEW* view =  s_PcbEditFrame->GetGalCanvas()->GetView();
>> item->MethodThatModifiesTheItemState();
>> view->Update( item );
> 
> Is this safe?  What happens when pcbnew is using the legacy canvas?

This is safe as long as view != nullptr, which normally is true.
VIEW::Update() is a lightweight method that only marks VIEW_ITEMs as
dirty, so they are updated the next time VIEW is drawn. When legacy
canvas is active, VIEW_ITEMs are marked as dirty and never refreshed,
nothing more happens.

Regards,
Orson

Attachment: signature.asc
Description: OpenPGP digital signature


References