EDA_ITEM does not belong in VIEW

This commit is contained in:
Marek Roszko 2023-09-25 19:30:33 -04:00
parent 92cbd0f599
commit 7010f7963c
2 changed files with 5 additions and 8 deletions

View File

@ -26,7 +26,6 @@
*/
#include <eda_item.h>
#include <layer_ids.h>
#include <trace_helpers.h>
@ -1315,7 +1314,7 @@ void VIEW::updateItemGeometry( VIEW_ITEM* aItem, int aLayer )
group = m_gal->BeginGroup();
viewData->setGroup( aLayer, group );
if( !m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer ) )
if( !m_painter->Draw( aItem, aLayer ) )
aItem->ViewDraw( aLayer, this ); // Alternative drawing method
m_gal->EndGroup();
@ -1634,7 +1633,7 @@ void VIEW::ClearPreview()
m_preview->Clear();
for( EDA_ITEM *item : m_ownedItems )
for( VIEW_ITEM* item : m_ownedItems )
delete item;
m_ownedItems.clear();
@ -1649,7 +1648,7 @@ void VIEW::InitPreview()
}
void VIEW::AddToPreview( EDA_ITEM* aItem, bool aTakeOwnership )
void VIEW::AddToPreview( VIEW_ITEM* aItem, bool aTakeOwnership )
{
Hide( aItem, false );
m_preview->Add( aItem );

View File

@ -38,8 +38,6 @@
#include <view/view_overlay.h>
#include <view/view.h>
class EDA_ITEM;
namespace KIGFX
{
class PAINTER;
@ -712,7 +710,7 @@ public:
void InitPreview();
void ClearPreview();
void AddToPreview( EDA_ITEM* aItem, bool aTakeOwnership = true );
void AddToPreview( VIEW_ITEM* aItem, bool aTakeOwnership = true );
void ShowPreview( bool aShow = true );
@ -832,7 +830,7 @@ protected:
struct UPDATE_DEPTH_VISITOR;
std::unique_ptr<KIGFX::VIEW_GROUP> m_preview;
std::vector<EDA_ITEM *> m_ownedItems;
std::vector<VIEW_ITEM *> m_ownedItems;
///< Whether to use rendering order modifier or not.
bool m_enableOrderModifier;