(x, y, width, height, options)
| 1943 | } |
| 1944 | |
| 1945 | function rect(x, y, width, height, options) { |
| 1946 | /* Draws a rectangle with the top left corner at x, y. |
| 1947 | * The current stroke, strokewidth, strokestyle and fill color are applied. |
| 1948 | */ |
| 1949 | // It is faster to do it directly without creating a Path: |
| 1950 | var a = _colorMixin(options); |
| 1951 | if (a[0] && a[0].a > 0 || a[1] && a[1].a > 0) { |
| 1952 | if (!options || options.roundness === undefined) { |
| 1953 | _ctx.beginPath(); |
| 1954 | _ctx.rect(x, y, width, height); |
| 1955 | _ctx_fill(a[0]); |
| 1956 | _ctx_stroke(a[1], a[2], a[3], a[4]); |
| 1957 | } else { |
| 1958 | var p = new Path(); |
| 1959 | p.rect(x, y, width, height, options); |
| 1960 | p.draw(options); |
| 1961 | } |
| 1962 | } |
| 1963 | } |
| 1964 | |
| 1965 | function triangle(x1, y1, x2, y2, x3, y3, options) { |
| 1966 | /* Draws the triangle created by connecting the three given points. |
no test coverage detected
searching dependent graphs…