graphics-customshape-source.mustache revision d1a404610f53bdff63cde29a00ea9cf48739d91e
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste<div id="mygraphiccontainer"></div>
9a9e9f9aa372dc00549820097d30655761b72893Jaco JoosteYUI({filter:"raw"}).use('graphics', function (Y)
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste var RoundedRect = function()
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste RoundedRect.superclass.constructor.apply(this, arguments);
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste RoundedRect.NAME = "roundedRect";
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste _draw: function()
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste var w = this.get("width"),
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste h = this.get("height"),
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste ew = this.get("ellipseWidth"),
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste eh = this.get("ellipseHeight");
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste this.quadraticCurveTo(w, h, w, h - eh);
9a9e9f9aa372dc00549820097d30655761b72893Jaco Jooste this.quadraticCurveTo(w, 0, w - ew, 0);
ATTRS: Y.mix({
}, Y.Shape.ATTRS)
Y.RoundedRect = RoundedRect;
var mygraphic = new Y.Graphic({render: "#mygraphiccontainer"}),
myroundrect = mygraphic.addShape({
type: Y.RoundedRect,