Honour originTransforms in search panels.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15031
This commit is contained in:
Jeff Young 2023-11-09 18:40:47 +00:00
parent 5cd1a4674f
commit 6ecfc89a4a
4 changed files with 16 additions and 12 deletions

View File

@ -25,7 +25,6 @@
*/
#include <bezier_curves.h>
#include <base_units.h>
#include <convert_basic_shapes_to_polygon.h>
#include <eda_draw_frame.h>
#include <geometry/shape_simple.h>
@ -710,8 +709,7 @@ wxString EDA_SHAPE::GetFriendlyName() const
void EDA_SHAPE::ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
ORIGIN_TRANSFORMS originTransforms = aFrame->GetOriginTransforms();
wxString msg;
wxString msg;
wxString shape = _( "Shape" );
aList.emplace_back( shape, GetFriendlyName() );

View File

@ -26,7 +26,7 @@
#ifndef PCB_BASE_FRAME_H
#define PCB_BASE_FRAME_H
#include <eda_units.h>
#include <eda_item.h>
#include <board.h>
#include <eda_draw_frame.h>
@ -144,6 +144,11 @@ public:
*/
ORIGIN_TRANSFORMS& GetOriginTransforms() override;
wxString MessageTextFromCoord( int aValue, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType ) const
{
return MessageTextFromValue( m_originTransforms.ToDisplay( aValue, aCoordType ) );
}
const TITLE_BLOCK& GetTitleBlock() const override;
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override;

View File

@ -430,7 +430,7 @@ void PCB_DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame,
aList.emplace_back( _( "Text Width" ), unitsProvider.MessageTextFromValue( GetTextWidth() ) );
aList.emplace_back( _( "Text Height" ), unitsProvider.MessageTextFromValue( GetTextHeight() ) );
ORIGIN_TRANSFORMS originTransforms = aFrame->GetOriginTransforms();
ORIGIN_TRANSFORMS& originTransforms = aFrame->GetOriginTransforms();
if( Type() == PCB_DIM_CENTER_T )
{
@ -1184,7 +1184,7 @@ void PCB_DIM_LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PA
// Don't use GetShownText(); we want to see the variable references here
aList.emplace_back( _( "Leader" ), KIUI::EllipsizeStatusText( aFrame, GetText() ) );
ORIGIN_TRANSFORMS originTransforms = aFrame->GetOriginTransforms();
ORIGIN_TRANSFORMS& originTransforms = aFrame->GetOriginTransforms();
VECTOR2I startCoord = originTransforms.ToDisplayAbs( GetStart() );
wxString start = wxString::Format( wxT( "@(%s, %s)" ),

View File

@ -124,9 +124,9 @@ wxString FOOTPRINT_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol )
else if( aCol == 2 )
return fp->GetLayerName();
else if( aCol == 3 )
return m_frame->MessageTextFromValue( fp->GetX() );
return m_frame->MessageTextFromCoord( fp->GetX(), ORIGIN_TRANSFORMS::ABS_X_COORD );
else if( aCol == 4 )
return m_frame->MessageTextFromValue( fp->GetY() );
return m_frame->MessageTextFromCoord( fp->GetY(), ORIGIN_TRANSFORMS::ABS_Y_COORD );
return wxEmptyString;
}
@ -188,9 +188,10 @@ wxString ZONE_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol )
else if( aCol == 3 )
return wxString::Format( "%d", zone->GetAssignedPriority() );
else if( aCol == 4 )
return m_frame->MessageTextFromValue( zone->GetX() );
return m_frame->MessageTextFromCoord( zone->GetX(), ORIGIN_TRANSFORMS::ABS_X_COORD );
else if( aCol == 5 )
return m_frame->MessageTextFromValue( zone->GetY() );
return m_frame->MessageTextFromCoord( zone->GetY(), ORIGIN_TRANSFORMS::ABS_Y_COORD );
return wxEmptyString;
}
@ -252,9 +253,9 @@ wxString TEXT_SEARCH_HANDLER::getResultCell( BOARD_ITEM* aItem, int aCol )
else if( aCol == 2 )
return aItem->GetLayerName();
else if( aCol == 3 )
return m_frame->MessageTextFromValue( aItem->GetX() );
return m_frame->MessageTextFromCoord( aItem->GetX(), ORIGIN_TRANSFORMS::ABS_X_COORD );
else if( aCol == 4 )
return m_frame->MessageTextFromValue( aItem->GetY() );
return m_frame->MessageTextFromCoord( aItem->GetY(), ORIGIN_TRANSFORMS::ABS_Y_COORD );
return wxEmptyString;
}