fixed post-rebase issues

This commit is contained in:
Tomasz Włostowski 2016-12-05 23:54:41 +01:00 committed by Maciej Suminski
parent c661c30f68
commit 3f7c5a0845
9 changed files with 17 additions and 31 deletions

View File

@ -1061,16 +1061,13 @@ void VIEW::invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags )
int layers[VIEW_MAX_LAYERS], layers_count; int layers[VIEW_MAX_LAYERS], layers_count;
aItem->ViewGetLayers( layers, layers_count ); aItem->ViewGetLayers( layers, layers_count );
printf("invlidate %p", aItem); // Iterate through layers used by the item and recache it immediately
// Iterate through layers used by the item and recache it immediately
for( int i = 0; i < layers_count; ++i ) for( int i = 0; i < layers_count; ++i )
{ {
int layerId = layers[i]; int layerId = layers[i];
if( IsCached( layerId ) ) if( IsCached( layerId ) )
{ {
printf("updateGeom %p flg %d\n", aItem, aUpdateFlags );
if( aUpdateFlags & ( GEOMETRY | LAYERS ) ) if( aUpdateFlags & ( GEOMETRY | LAYERS ) )
updateItemGeometry( aItem, layerId ); updateItemGeometry( aItem, layerId );
else if( aUpdateFlags & COLOR ) else if( aUpdateFlags & COLOR )
@ -1136,8 +1133,6 @@ void VIEW::updateItemGeometry( VIEW_ITEM* aItem, int aLayer )
group = m_gal->BeginGroup(); group = m_gal->BeginGroup();
viewData->setGroup( aLayer, group ); viewData->setGroup( aLayer, group );
printf("upadteGeom2: %p\n", aItem );
if( !m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer ) ) if( !m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer ) )
aItem->ViewDraw( aLayer, this ); // Alternative drawing method aItem->ViewDraw( aLayer, this ); // Alternative drawing method
@ -1345,6 +1340,7 @@ void VIEW::Update( VIEW_ITEM *aItem, int aUpdateFlags )
return; return;
assert( aUpdateFlags != NONE ); assert( aUpdateFlags != NONE );
bool firstTime = (viewData->m_requiredUpdate == NONE); bool firstTime = (viewData->m_requiredUpdate == NONE);
viewData->m_requiredUpdate |= aUpdateFlags; viewData->m_requiredUpdate |= aUpdateFlags;
@ -1361,9 +1357,7 @@ void VIEW::MarkForUpdate( VIEW_ITEM* aItem )
{ {
auto viewData = aItem->viewPrivData(); auto viewData = aItem->viewPrivData();
printf("MarkForUpdate %p\n", aItem); assert( viewData->m_requiredUpdate != NONE );
assert( viewData->m_requiredUpdate != NONE );
for ( auto item : m_needsUpdate ) for ( auto item : m_needsUpdate )
assert(item != aItem); assert(item != aItem);

View File

@ -52,7 +52,7 @@ public:
void ViewDraw( int aLayer, VIEW* aView ) const override; void ViewDraw( int aLayer, VIEW* aView ) const override;
void ViewGetLayers( int aLayers[], int& aCount ) constm override void ViewGetLayers( int aLayers[], int& aCount ) const override
{ {
aLayers[0] = ITEM_GAL_LAYER( GP_OVERLAY ); aLayers[0] = ITEM_GAL_LAYER( GP_OVERLAY );
aCount = 1; aCount = 1;

View File

@ -90,13 +90,12 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry)
assert( ent.m_item->Type() == PCB_MODULE_T ); assert( ent.m_item->Type() == PCB_MODULE_T );
assert( ent.m_copy->Type() == PCB_MODULE_T ); assert( ent.m_copy->Type() == PCB_MODULE_T );
if ( aCreateUndoEntry ) if ( aCreateUndoEntry )
{ {
ITEM_PICKER itemWrapper( ent.m_item, UR_CHANGED ); ITEM_PICKER itemWrapper( ent.m_item, UR_CHANGED );
itemWrapper.SetLink( ent.m_copy ); itemWrapper.SetLink( ent.m_copy );
undoList.PushItem( itemWrapper ); undoList.PushItem( itemWrapper );
frame->SaveCopyInUndoList( undoList, UR_CHANGED ); frame->SaveCopyInUndoList( undoList, UR_CHANGED );
} }
savedModules.insert( ent.m_item ); savedModules.insert( ent.m_item );
@ -111,7 +110,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry)
if( !m_editModules ) if( !m_editModules )
{ {
if ( aCreateUndoEntry ) if ( aCreateUndoEntry )
undoList.PushItem( ITEM_PICKER( boardItem, UR_NEW ) ); undoList.PushItem( ITEM_PICKER( boardItem, UR_NEW ) );
if( !( changeFlags & CHT_DONE ) ) if( !( changeFlags & CHT_DONE ) )
board->Add( boardItem ); board->Add( boardItem );
@ -256,7 +255,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry)
if ( boardItem->Type() == PCB_MODULE_T ) if ( boardItem->Type() == PCB_MODULE_T )
{ {
MODULE* module = static_cast<MODULE*>( boardItem ); MODULE* module = static_cast<MODULE*>( boardItem );
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Update, view, _1 ) ); module->RunOnChildren( [&view] ( BOARD_ITEM *aItem ){ view->Update( aItem ); } );
} }
view->Update ( boardItem ); view->Update ( boardItem );

View File

@ -566,7 +566,7 @@ public:
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override; virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
/// @copydoc VIEW_ITEM::ViewGetLOD() /// @copydoc VIEW_ITEM::ViewGetLOD()
virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ); virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
/// @copydoc VIEW_ITEM::ViewBBox() /// @copydoc VIEW_ITEM::ViewBBox()
virtual const BOX2I ViewBBox() const override; virtual const BOX2I ViewBBox() const override;

View File

@ -33,6 +33,7 @@
#include <dialog_global_edit_tracks_and_vias.h> #include <dialog_global_edit_tracks_and_vias.h>
#include <view/view.h>
/** /**
* DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS, derived from DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_BASE * DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS, derived from DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE_BASE
@ -260,7 +261,7 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnOkClick( wxCommandEvent& event )
if( m_parent->IsGalCanvasActive() ) if( m_parent->IsGalCanvasActive() )
{ {
for( TRACK* track = m_parent->GetBoard()->m_Track; track != NULL; track = track->Next() ) for( TRACK* track = m_parent->GetBoard()->m_Track; track != NULL; track = track->Next() )
track->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); m_parent->GetGalCanvas()->GetView()->Update(track, KIGFX::GEOMETRY );
} }
else else
m_parent->GetCanvas()->Refresh(); m_parent->GetCanvas()->Refresh();

View File

@ -239,7 +239,8 @@ void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment )
segm = (TRACK*) itemsListPicker.GetPickedItem( ii ); segm = (TRACK*) itemsListPicker.GetPickedItem( ii );
segm->Draw( m_canvas, aDC, GR_OR ); // Display new track shape segm->Draw( m_canvas, aDC, GR_OR ); // Display new track shape
segm->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); // fixme: commit!
// segm->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
} }
m_canvas->CrossHairOn( aDC ); // Display cursor shape m_canvas->CrossHairOn( aDC ); // Display cursor shape

View File

@ -40,8 +40,6 @@ BRIGHT_BOX::BRIGHT_BOX () :
void BRIGHT_BOX::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const void BRIGHT_BOX::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
{ {
printf("DrawBB item %p\n", m_item);
if( !m_item ) if( !m_item )
return; return;

View File

@ -39,7 +39,7 @@
class BRIGHT_BOX : public EDA_ITEM class BRIGHT_BOX : public EDA_ITEM
{ {
public: public:
BRIGHT_BOX( BOARD_ITEM* aItem ); BRIGHT_BOX();
~BRIGHT_BOX() {}; ~BRIGHT_BOX() {};
virtual const BOX2I ViewBBox() const override virtual const BOX2I ViewBBox() const override

View File

@ -743,7 +743,6 @@ int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent )
void SELECTION_TOOL::clearSelection() void SELECTION_TOOL::clearSelection()
{ {
printf("ClearSelection\n");
if( m_selection.Empty() ) if( m_selection.Empty() )
return; return;
@ -821,7 +820,7 @@ BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector )
getView()->SetVisible( &brightBox, true ); getView()->SetVisible( &brightBox, true );
// getView()->Hide( &brightBox, false ); // getView()->Hide( &brightBox, false );
getView()->Update( &brightBox, KIGFX::GEOMETRY ); getView()->Update( &brightBox, KIGFX::GEOMETRY );
// getView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY ); getView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY );
} }
} }
@ -1033,17 +1032,11 @@ void SELECTION_TOOL::selectVisually( BOARD_ITEM* aItem ) const
void SELECTION_TOOL::unselectVisually( BOARD_ITEM* aItem ) const void SELECTION_TOOL::unselectVisually( BOARD_ITEM* aItem ) const
{ {
printf("UnselectVisually %p\n", aItem);
// Restore original item visibility // Restore original item visibility
aItem->ClearSelected(); aItem->ClearSelected();
view()->Hide( aItem, false ); view()->Hide( aItem, false );
view()->Update( aItem, KIGFX::ALL ); view()->Update( aItem, KIGFX::ALL );
printf("%d %d %d\n",
!!aItem->IsSelected(),
!!aItem->IsHighlighted(),
!!aItem->IsBrightened() );
// Modules are treated in a special way - when they are selected, we have to // Modules are treated in a special way - when they are selected, we have to
// unselect all the parts that make the module, not the module itself // unselect all the parts that make the module, not the module itself