• 0

Attachable Edge Label orientation



I am attempting to use the attachable edge labels to display an icon rather than a piece of text.  This part I have working absolutely fine, however I am attempting to stop the label from flipping so that the text/icon is always facing a particular direction.  This is obviously a useful thing to keep text orientated in a readable way, however, i would like to stop my icon from flipping 180 degrees.

This wouldn't normally be a problem, but since one of my icons is a Diode (pointing Source[Vertex] to Target[Vertex]), I would like it to stay pointing in the same direction.

See attachments for images showing what I mean:

5b856b39ca618_edgeorientation1.PNG.ac33a1e43019df74496db1ceadc177e4.PNG 'edge orientation 1' shows a diode in the middle of an edge (Orange vertex is Source, Blue vertex id Target)

5b856c12be071_edgeorientation2.PNG.ed8b427c7e7d410cf948a58118bf6d22.PNG'edge orientation 2' shows the same Edge between the same Vertices after being moved to sit 180 degrees away from its original position

My aim is to get the diode icon in 'edge orientation 2' to sit facing Source [Orange]  to Target [Blue].


In my current AttachableEdgeLabelControl,  I have AlignToEdge = true & FlipOnRotation = false.  However, looking at the Source Code it seems like the following snippet is flipping the label anyway:

var p1 = EdgeControl.SourceConnectionPoint.GetValueOrDefault();

var p2 = EdgeControl.TargetConnectionPoint.GetValueOrDefault();

bool flipAxis = p1.X > p2.X;

if (flipAxis)

      Angle += 180;


I understand why this happens when a label consists of text, but there doesn't seem to be a way to stop it from happening if I need to.

Could you please shed some light as to whether this is achievable for me?  I would greatly appreciate it!




Share this post

Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now