Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rectilinear transitions not moved consistently when moving parent state machine #3071

Open
1 of 3 tasks
ebousse opened this issue Feb 2, 2024 · 4 comments
Open
1 of 3 tasks
Labels
bug An issue in the application

Comments

@ebousse
Copy link

ebousse commented Feb 2, 2024

Describe the bug

With a diagram containing a state machine element that includes states and rectilinear transitions, when moving the state machine element around, rectilinear transitions are not moved consistently − some of their lines don't move while everything else moves.

To Reproduce

  1. Create a new class diagram.
  2. Add a state machine element.
  3. Add two states and a transition between the two states.
  4. Make the transition rectilinear.
  5. Drag the transition in order to bend it in some direction.
  6. Select the parent state machine, and drag it around.

Expected behavior

Part of the transition is not moved correctly.

Screenshots

Video:

Capture.video.du.2024-02-02.14-19-10.webm

OS

  • Linux (Fedora 39, GNOME)
  • macOS
  • Windows

Version

Version of Gaphor: 2.23.2

Additional information

I have the vague impression that I may have already submitted this bug in the past, but I can't seem to find it, so maybe my memory is playing me tricks!

@danyeaw danyeaw added the bug An issue in the application label Feb 4, 2024
@danyeaw
Copy link
Member

danyeaw commented Feb 4, 2024

Hi @ebousse, thanks I can reproduce this.

@FranciscoTGouveia
Copy link
Contributor

Hi! When I was working with Gaphor for prototyping the structure of a university project I noticed this bug too, so I was wondering if this was a good-first-issue to start. I've already reproduced the bug in my machine and want to give this issue a go. Looking at the culture of the project and past issues, I didn't see many "assigns", so I was wondering if you could assign this issue to me ?

@danyeaw
Copy link
Member

danyeaw commented Feb 23, 2024

Hey @FranciscoTGouveia, glad to have your contributions!

@FranciscoTGouveia
Copy link
Contributor

Hi @danyeaw, I spent the past month trying to fix this bug, but it's a lot deeper than what I thought. Firstly, I noticed that this issue isn’t exclusive to State Machines but it also encompasses other diagrams such as UML. Moreover, the initial bug report describes a bug where rectilinear transitions are not moved consistently, but what I found out is that, if a transition is not rectilinear, the new handle created in the split_segment function will be static and not move at all.

I’ve tried to follow the trace of the split_segment and _on_orthogonal_change functions but without any success, since it always leads me to Gaphas. When calling split_segment in the segment.py file I’ve tried to call the insert_handle function of the class Line Presentation but it didn’t seem to be it, so I looked into the _on_orthogonal_change function, and it creates a new handle and automatically binds it to the parent element, so I think that the solution consists in putting part of the logic of the orthogonal change, to the more general function split_segment. We can do this easily but it would mean that all segments would be rectilinear, losing functionality.

When I look more carefully at the on_orthogonal_change function, the instruction that allows the newly created handle to be moved consistently with the parent element is self.item.orthogonal = active, which is an attribute only used in gaphas. I looked into the item.py file in Gaphas to find out that the attribute orthogonal just forces the creation of two EqualConstrainst’s.

With that said, I don’t know what the consequences of tinkering with these constraints in Gaphas would be, and I’m afraid it could be a breaking change. Under those circumstances, I would be more comfortable to leave this issue for a more experienced developer. With that said, I think it would be for the best to release the assignment so more people can have their chance to tackle this issue.

@FranciscoTGouveia FranciscoTGouveia removed their assignment Apr 21, 2024
@amolenaar amolenaar changed the title [State machines] Rectilinear transitions not moved consistently when moving parent state machine Rectilinear transitions not moved consistently when moving parent state machine Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue in the application
Projects
None yet
Development

No branches or pull requests

3 participants