pcbnew ctrl-M moveIndividually command destroys track segments

56 views
Skip to first unread message

Stuart Tyler

unread,
Jul 6, 2023, 10:27:09 AM7/6/23
to KiCad Developers
Hi,
I have my KiCad Windows development system going and browsing my way through pcbnew, getting up to speed on the internal workings of moving and dragging.

I think I have observed an issue in moveIndividually, the ctrl-M command. When you select multiple traces, the first trace is moved nicely, but every trace after that is mangled. I believe this is because in edit_tool_move_fct.cpp on line 717:
 nextItem->SetPosition( controls->GetMousePosition( true ) );

When the item is a track, only one end of the track is moved, and so now the tack shape is mangled.

When this line is commented out, the track shape is maintained, but the grab position is not at the track and is really annoying. As this is my first playing with KiCad and pcbnew, I am unsure on how to make the mouse position warp to the current track location, or move the track to the current mouse location without damaging the track shape.

This would then fix the moveIndividually ctrl-M command for tracks.

Regards
Stuart

Stuart Tyler

unread,
Jul 6, 2023, 11:07:36 AM7/6/23
to KiCad Developers, Stuart Tyler
I have been digging and understanding more - I believe line 717 in edit_tool_move_fct.cpp should be:

                    nextItem->Move( controls->GetMousePosition( true ) - nextItem->GetPosition());

This moves the item to the current cursor, without destroying the shape of the track if the item is a track.
A set position method would be really nice to have, but this in effect does the same thing.

Feel free to direct me on what to do with this information. I am just getting my feet and Im an adult, so just let me know directly if posting this information here is the wrong thing to do. I think I found an issue, and the solution, but what to do next - I have no idea. 

Regards
Stuart

Mark Visser

unread,
Jul 6, 2023, 12:18:30 PM7/6/23
to dev...@kicad.org, Stuart Tyler
Hi Stuart, I’m not an official captial-D KiCad Developer, but I have submitted a fix for a different issue. It was as simple as:

1. Log an issue in gitlab. Follow the instructions in the issue template, and especially make sure the steps to reproduce are clear. Include images or gifs if helpful. Make sure you explain why the reported behaviour is a problem.
2. Fork the repo on gitlab.
3. Clone your forked repo and apply the fix in a branch.
4. Push your branch to your fork.
5. Open a pull request. Follow the instructions in the template, and be sure the before and after behaviour is clear. Again, images or gifs may be helpful.
6. Wait for comments.
7. Address any comments.
8. When the fix has been approved, an official developer will merge it.

And of course, you should exhaustively test your fix. Unfortunately KiCad doesn’t have automated tests for UI, so the onus is on you to ensure your patch fixes the problem AND doesn’t introduce any regressions.

If you haven’t already, make sure you read the KiCad developer culture page: https://dev-docs.kicad.org/en/rules-guidelines/culture/



-- 
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion on the web visit https://groups.google.com/a/kicad.org/d/msgid/devlist/f51b36b1-e094-4727-b0cf-5e6f56c678a1n%40kicad.org.

Stuart Tyler

unread,
Jul 6, 2023, 2:21:21 PM7/6/23
to KiCad Developers, mjmv...@gmail.com, Stuart Tyler
Thank you for the guidance. Being a HW engineer at the core, its the first time doing forking, so I am coming unstuck somewhere and in need of a bit more hand holding at the last hurdle.

I forked the repo on GitLab. I then cloned it. I then branched it and made my code changes, and pushed all the way back to my fork on GitLab.

Now the merge bit back to KiCad is throwing me because the target repo goes to my repo, and all the other repos dont make sense.

Im assuming I press on the "New merge request" button on the right hand side from the Merge request page.
Screenshot 2023-07-06 191435.png

I get presented with this.

Screenshot 2023-07-06 191658.png

I can find my branch from my forked repo, but the target is non-obvious.
 Screenshot 2023-07-06 191851.png

What is the target to send to for Kicad to get my merge request?
Or have I done something wrong somewhere?

Thanks
Stuart

Andrew Lutsenko

unread,
Jul 6, 2023, 11:16:14 PM7/6/23
to dev...@kicad.org, mjmv...@gmail.com, Stuart Tyler
Hi  Stuart,

Easiest way to open a merge request after you have pushed commits to a branch in your fork is to use the link that git will helpfully print to the terminal in the output of the push command.
If you have missed that link then you can go to your fork, navigate to branches in the left menu and then click "New" for the corresponding branch. Gitlab should skip the branch selection step and automatically choose the default branch of the repo you forked from.

I think in your case gitlab is confused about the target branch because normally you initiate merge requests in the fork that you merge from, not the fork you merge to.

Best,
Andrew

Stuart Tyler

unread,
Jul 8, 2023, 4:13:21 AM7/8/23
to KiCad Developers, Stuart Tyler, mjmv...@gmail.com
Thank you for the hints from various people. I deleted my original fork and started again and it worked this time. I believe my merge request is in. Thanks for helping me out.

Regards
Stuart

Reply all
Reply to author
Forward
0 new messages