simulton / QSchematic

A library that allows creating diagrams such as flowcharts or even proper engineering schematics within a Qt application.
https://simulton.com
MIT License
231 stars 60 forks source link

Moving a point of a wire, from graphics does not respect straight angles #29

Open ChristianWieden opened 3 years ago

ChristianWieden commented 3 years ago

Moving a wire point via UI calls mouseMoveEvent in items/wire.cpp which then hands over the move to class CommandWirepointMove. This class then does the transformation in the Constructor, but it does not check if straight angles should be preservered.

But wire_system/wire.cpp has this functionality, and has testcases for this, so why not call this function?

Tectu commented 3 years ago

I think this is a simple oversight from when the dedicated/separated wire system was introduced. Before this the wire handling algorithms were baked into the overall code of the library. The idea of separating the wire system into a separate component was to make the code more portable and easier to test without anything being tied to the UI side of things.

This new component certainly needs some polishing and it's likely that functionality was not migrated completely - Pull requests are welcomed :)