kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #39910
Re: [PATCH] Eeschema: place new field near parent component
Hi Konstantin,
I have applied this patch to both the development and the 5.1 branches.
Thank you for helping KiCad!
Cheers,
John
On Tue, Mar 26, 2019 at 8:15 PM Baranovskiy Konstantin
<baranovskiykonstantin@xxxxxxxxx> wrote:
>
> For now fields created in Fields Editor are placed at
> position (0, 0).
> Every new field must be placed at the origin of
> the parent component.
> ---
> eeschema/dialogs/dialog_fields_editor_global.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp
> index dd2c9ae73..f68dc6d5c 100644
> --- a/eeschema/dialogs/dialog_fields_editor_global.cpp
> +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp
> @@ -604,7 +604,7 @@ public:
> SCH_FIELD* destField = comp->FindField( srcName );
>
> if( !destField && !srcValue.IsEmpty() )
> - destField = comp->AddField( SCH_FIELD( wxPoint( 0, 0 ), -1, comp, srcName ) );
> + destField = comp->AddField( SCH_FIELD( comp->GetPosition(), -1, comp, srcName ) );
>
> if( destField && !srcValue.IsEmpty() )
> destField->SetText( srcValue );
> --
> 2.21.0
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
References