Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic InvalidOperationException error with same points (Read 871 times)
Ivan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Jul 26th, 2022
InvalidOperationException error with same points
Jul 27th, 2022 at 7:23am
Print Post  
MindFusion.Diagramming.Wpf version 3.8.1 throws exception when there are two same control points:

System.InvalidOperationException: 'Invalid number of points for a Bezier link.'

For example in version 3.4.0 was working fine.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: InvalidOperationException error with same points
Reply #1 - Jul 27th, 2022 at 8:17am
Print Post  
Hi,

ControlPoints help topic says that Bézier links have four control points per segment, and you should really stick to that or will get index exceptions later on. If you need to show Bezier link as a straight line initially, insert two control points between the end ones at (dx* 1/3, dy * 1/3) and (dx * 2/3, dy * 2/3) offsets from first point.

v3.4 would through same exception too if you call UpdateFromPoints(bool updateGroups, bool updateSegmentCount) overload with true for second arg. We've eliminated the internal segmentCount variable since then, as it was causing bugs when number of control points and number of segments diverge. The SegmentCount property getter now determines value from number of control points, and its setter resets control points to appropriate number.

Anyway, if the exception is not thrown after you directly assign to ControlPoints but due to other operations of the diagram, please give us more details how to reproduce.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint