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

rectangle with rounded edges?

11 Answers 500 Views
Drawing API
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 06 Oct 2015, 04:28 PM

 

I'd like to use the Kendo UI drawing API (instead of the SnapSVG we were using). It seems limited though. I need a rectangle with a rounded edge. I see documentation on how to do a regular rectangle, but how do I do a rounded edge?

 

John

 

11 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 08 Oct 2015, 08:44 AM
Hello John,

Rounded edges are not currently supported out of the box but can be implemented by drawing a path(live demo).

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
John
Top achievements
Rank 1
answered on 08 Oct 2015, 07:52 PM

Hey, great! Thanks for the demo. One thing I'm concerned about; I'm trying to code this up in TypeScript, and the curveTo calls is the kendo.all.d.ts don't seem to match what you have in your createRoundedRect() body (in particular, the third parameter). The definition file contains these choices:

curveTo(controlOut: any, controlIn: any): kendo.drawing.Path;
curveTo(controlOut: any, controlIn: kendo.geometry.Point): kendo.drawing.Path;
curveTo(controlOut: kendo.geometry.Point, controlIn: any): kendo.drawing.Path;
curveTo(controlOut: kendo.geometry.Point, controlIn: kendo.geometry.Point): kendo.drawing.Path;

Is the definition file not correct, or am I using it wrong?

 

 

 

0
Daniel
Telerik team
answered on 12 Oct 2015, 10:40 AM
Hello again John,

The issue is with the definitions. We will fix it for the next internal build.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
John
Top achievements
Rank 1
answered on 12 Oct 2015, 10:49 PM
Great, thank you. :-)
0
John
Top achievements
Rank 1
answered on 12 Oct 2015, 11:14 PM

Related, it appears the PDFOptions interface in the TypeScript definitions file is not quite correct:

 

interface PDFOptions {
creator: string;
date: Date;
keywords: string;
landscape: boolean;
margin: any;
paperSize: any;
subject: string;
title: string;

}

 

These should all have a questionmark at the end, right, so they are optional? It's requiring that I add ALL the options, which isn't necesss

 

0
John
Top achievements
Rank 1
answered on 12 Oct 2015, 11:21 PM
And... why does kendo.geometry.Rect have a constructor, but kendo.geometry.Point has static create() methods, and kendo.geometry.Class has neither a constructor or static create methods?
0
John
Top achievements
Rank 1
answered on 12 Oct 2015, 11:27 PM
And... why does kendo.geometry.Rect have a constructor, but kendo.geometry.Point has static create() methods, and kendo.geometry.Class has neither a constructor or static create methods?
0
John
Top achievements
Rank 1
answered on 12 Oct 2015, 11:31 PM

Sorry, yet another issue: the TypeScript definitions file doesn't have this:

 

kendo.drawing.pdf.saveAs(...)

 Which is what's used in the example. In fact, the kendo.drawing.pdf module doesn't seem to be there at all.

 

Is the TypeScript Definitions file behind a version, that I'm having all these issues?

 

0
Daniel
Telerik team
answered on 15 Oct 2015, 08:50 AM
Thanks. We will update the definitions. 

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
John
Top achievements
Rank 1
answered on 15 Oct 2015, 03:41 PM

Thanks.... 

 Another issue: the StrokeOptions interface is requiring all fields, even though they should all be optional.

When do you anticipate a fixed version might be available for me to use?

0
Daniel
Telerik team
answered on 19 Oct 2015, 10:41 AM
Hello John,

We noticed this too. Will be fixed along with the Fill and PDF options. An internal build with the updates should be available by the end of the week.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Drawing API
Asked by
John
Top achievements
Rank 1
Answers by
Daniel
Telerik team
John
Top achievements
Rank 1
Share this question
or