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
Rounded edges are not currently supported out of the box but can be implemented by drawing a path(live demo).
Regards,
Daniel
Telerik
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?
The issue is with the definitions. We will fix it for the next internal build.
Regards,
Daniel
Telerik
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
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?
Regards,
Daniel
Telerik
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?
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