Skip to content

Instantly share code, notes, and snippets.

@tripp
Created February 19, 2013 18:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tripp/4988469 to your computer and use it in GitHub Desktop.
Chaining Example
YUI({
filter:"raw"
}).use('graphics', function (Y)
{
var w = 300,
h = 200,
ew = 15,
eh = 15,
mygraphic = new Y.Graphic({
render: "#mygraphiccontainer"
}),
mypath = mygraphic.addShape({
type: "path",
x: 50,
y: 50,
fill: {
color: "#0f0"
},
stroke: {
weight: 2,
color: "#000"
}
});
mypath.clear().
moveTo(0, eh).
lineTo(0, h - eh).
quadraticCurveTo(0, h, ew, h).
lineTo(w - ew, h).
quadraticCurveTo(w, h, w, h - eh).
lineTo(w, eh).
quadraticCurveTo(w, 0, w - ew, 0).
lineTo(ew, 0).
quadraticCurveTo(0, 0, 0, eh).
end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment