Cut corners in rectangular geometry

5 posts, 0 answers
  1. Borys
    Borys avatar
    2 posts
    Member since:
    Feb 2014

    Posted 27 Nov 2014 Link to this post

    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.
  2. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 01 Dec 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 01 Dec 2014 Link to this post

    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.

     
  5. Borys
    Borys avatar
    2 posts
    Member since:
    Feb 2014

    Posted 01 Dec 2014 in reply to Martin Link to this post

    Works fine.
    But I wish it would be more clear why it works like this.
  6. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 03 Dec 2014 Link to this post

    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.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready