This is a migrated thread and some comments may be shown as answers.

Cut corners in rectangular geometry

4 Answers 176 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Borys
Top achievements
Rank 1
Borys asked on 27 Nov 2014, 01:57 PM
We have noticed that rectangular shapes is incorrectly rendered on
resize. Following code expected to add to the diagram resizable straight
rectangle:

 

           
diagram.AddShape(new RadDiagramShape

                            
{

                                
Geometry = geometry,

                                 BorderBrush
= Brushes.Green,

                                 StrokeThickness
= thickness,

                                 Position
= new Point(50, 50),

                                 Background
= Brushes.Transparent

                            
});

 

           
Instead it draws rectangle with excluded corners.

Moreover if rectangle is been resized user can see strange effect when set and configuration of excluded
corners are changing. See it in action on this video: https://www.youtube.com/watch?v=dK4mXmlEOhc

We are using Telerik WPF
2013.3.1016.40

How resolve this error?
It depends on RadiusX, RadiusY (e.g. there are less cut corners when both set to 0.009), but never completely resolved.

 

Please help us to workaround
this problem in version we use.

4 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 01 Dec 2014, 09:08 AM
Hi Borys,

Thank you for the video and the code snippet. However, I was not able to reproduce the described behavior. Can you please elaborate a little more on your scenario by sending me an isolated runnable code that contains the diagram (and it shapes') settings and the geometry for the shape?

Also it would be helpful if you could send me a project demonstrating the issue. This way I can test it locally and investigate the reason behind this behavior.

Thank you for any help you can provide.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Martin Ivanov
Telerik team
answered on 01 Dec 2014, 09:55 AM
Hi Borys,

I am writing again because I misunderstand your requirement. Please excuse me for that.

Actually, the reported behavior is caused by the fact that the RadDiagramShapes expose a StrokeDashArray property that is bound to the Path's (that represents the shape geometry) StrokeDashArray and its default value is set to "1, 0" (or new DoubleCollection(1, 0)). 

To avoid the corner's clipping you can set the StrokeDashArray property to "Null" or "new DoubleCollection(0)".
shape = new RadDiagramShape
{
  .....
     StrokeDashArray = null,
  ...
};
Please try this and let me know if it works for you.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Borys
Top achievements
Rank 1
answered on 01 Dec 2014, 03:26 PM
Works fine.
But I wish it would be more clear why it works like this.
0
Martin Ivanov
Telerik team
answered on 03 Dec 2014, 12:32 PM
Hi Borys,

You can read more about the StrokeDashArray property in MSDN. Basically, it determines the pattern of the gaps used in the Stroke of the shape's geometry. As for choosing to set "1, 0" as a default value on the shapes, there is no particular reason that affects the diagrams' functionality. It is a design decision.

Please let me know if you have any further questions.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Diagram
Asked by
Borys
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Borys
Top achievements
Rank 1
Share this question
or