Fix non-visible-part or conversion items from getting selected.

Also renames lib_draw_item to lib_item to match the class.

Fixes: lp:1840170
* https://bugs.launchpad.net/kicad/+bug/1840170
This commit is contained in:
Jeff Young 2019-08-15 08:09:52 +01:00
parent d50dc4ff65
commit b4c8657904
25 changed files with 32 additions and 26 deletions

View File

@ -151,7 +151,7 @@ set( EESCHEMA_SRCS
lib_arc.cpp
lib_bezier.cpp
lib_circle.cpp
lib_draw_item.cpp
lib_item.cpp
lib_field.cpp
lib_pin.cpp
lib_polyline.cpp

View File

@ -24,7 +24,7 @@
#include <fctsys.h>
#include <sch_edit_frame.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <general.h>
#include <sch_bus_entry.h>
#include <sch_junction.h>

View File

@ -32,7 +32,7 @@
#include <general.h>
#include <lib_tree_item.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <lib_field.h>
#include <vector>
#include <multivector.h>

View File

@ -32,7 +32,7 @@
#include <sch_edit_frame.h>
#include <general.h>
#include <eeschema_id.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <lib_pin.h>
#include <sch_component.h>
#include <sch_sheet.h>

View File

@ -25,7 +25,7 @@
* @file dialog_lib_edit_draw_item.cpp
*/
#include <lib_draw_item.h>
#include <lib_item.h>
#include <class_libentry.h>
#include <dialog_lib_edit_draw_item.h>
#include <lib_edit_frame.h>

View File

@ -26,7 +26,7 @@
#ifndef LIB_ARC_H
#define LIB_ARC_H
#include <lib_draw_item.h>
#include <lib_item.h>
class TRANSFORM;

View File

@ -25,7 +25,7 @@
#ifndef LIB_BEZIER_H
#define LIB_BEZIER_H
#include <lib_draw_item.h>
#include <lib_item.h>
/**

View File

@ -25,7 +25,7 @@
#ifndef LIB_CIRCLE_H
#define LIB_CIRCLE_H
#include <lib_draw_item.h>
#include <lib_item.h>
class LIB_CIRCLE : public LIB_ITEM

View File

@ -30,7 +30,7 @@
#define CLASS_LIBENTRY_FIELDS_H
#include <eda_text.h>
#include <lib_draw_item.h>
#include <lib_item.h>
class SCH_LEGACY_PLUGIN_CACHE;

View File

@ -29,7 +29,7 @@
#include <msgpanel.h>
#include <general.h>
#include <lib_draw_item.h>
#include <lib_item.h>
const int fill_tab[3] = { 'N', 'F', 'f' };

View File

@ -33,7 +33,7 @@
class SCH_COMPONENT;
#include <eda_rect.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include "pin_shape.h"
#include "pin_type.h"

View File

@ -25,7 +25,7 @@
#ifndef _LIB_POLYLINE_H_
#define _LIB_POLYLINE_H_
#include <lib_draw_item.h>
#include <lib_item.h>
class LIB_POLYLINE : public LIB_ITEM

View File

@ -25,7 +25,7 @@
#ifndef LIB_RECTANGLE_H
#define LIB_RECTANGLE_H
#include <lib_draw_item.h>
#include <lib_item.h>
class LIB_RECTANGLE : public LIB_ITEM

View File

@ -36,7 +36,7 @@
#include <msgpanel.h>
#include <bitmaps.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <general.h>
#include <transform.h>
#include <lib_text.h>

View File

@ -26,7 +26,7 @@
#define LIB_TEXT_H
#include <eda_text.h>
#include <lib_draw_item.h>
#include <lib_item.h>
/**

View File

@ -30,7 +30,7 @@
#include <sch_base_frame.h>
#include <sch_screen.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <ee_collectors.h>
#include <core/optional.h>

View File

@ -42,7 +42,7 @@
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <netlist_object.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <symbol_lib_table.h>
#include <dialogs/dialog_schematic_find.h>

View File

@ -34,7 +34,7 @@
#include <general.h>
#include <vector>
#include <set>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <sch_pin.h>
#include <sch_base_frame.h>

View File

@ -37,7 +37,7 @@
#include <sch_screen.h>
#include <class_library.h>
#include <class_libentry.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <lib_id.h>
#include <sch_component.h>
#include <sch_connection.h>

View File

@ -28,7 +28,7 @@
#include <sch_line.h>
#include <sch_io_mgr.h>
#include <eagle_parser.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <geometry/seg.h>
#include <dlist.h>

View File

@ -26,7 +26,7 @@
#include <sch_item.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <lib_rectangle.h>
#include <lib_pin.h>
#include <lib_circle.h>

View File

@ -29,7 +29,7 @@
#include <macros.h>
#include <dlist.h>
#include <sch_item.h>
#include <lib_draw_item.h>
#include <lib_item.h>
#include <base_screen.h>
#include <title_block.h>
#include <page_info.h>

View File

@ -26,7 +26,7 @@
#include <functional>
#include <tools/ee_selection.h>
#include <sch_item.h>
#include <lib_draw_item.h>
#include <lib_item.h>
EDA_ITEM* EE_SELECTION::GetTopLeftItem( bool onlyModules ) const
{

View File

@ -1079,15 +1079,21 @@ bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, bool checkVisibilityO
case LIB_PART_T: // In libedit we do not want to select the symbol itself.
return false;
case LIB_ARC_T:
case LIB_CIRCLE_T:
case LIB_TEXT_T:
case LIB_RECTANGLE_T:
case LIB_POLYLINE_T:
case LIB_BEZIER_T:
case LIB_PIN_T:
{
LIB_EDIT_FRAME* editFrame = (LIB_EDIT_FRAME*) m_frame;
LIB_PIN* pin = (LIB_PIN*) aItem;
LIB_ITEM* lib_item = (LIB_ITEM*) aItem;
if( pin->GetUnit() && pin->GetUnit() != editFrame->GetUnit() )
if( lib_item->GetUnit() && lib_item->GetUnit() != editFrame->GetUnit() )
return false;
if( pin->GetConvert() && pin->GetConvert() != editFrame->GetConvert() )
if( lib_item->GetConvert() && lib_item->GetConvert() != editFrame->GetConvert() )
return false;
break;