|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
658 bytes
|
| Line | |
|---|
| 1 | import curveLinear from "./linear.js";
|
|---|
| 2 |
|
|---|
| 3 | export var curveRadialLinear = curveRadial(curveLinear);
|
|---|
| 4 |
|
|---|
| 5 | function Radial(curve) {
|
|---|
| 6 | this._curve = curve;
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | Radial.prototype = {
|
|---|
| 10 | areaStart: function() {
|
|---|
| 11 | this._curve.areaStart();
|
|---|
| 12 | },
|
|---|
| 13 | areaEnd: function() {
|
|---|
| 14 | this._curve.areaEnd();
|
|---|
| 15 | },
|
|---|
| 16 | lineStart: function() {
|
|---|
| 17 | this._curve.lineStart();
|
|---|
| 18 | },
|
|---|
| 19 | lineEnd: function() {
|
|---|
| 20 | this._curve.lineEnd();
|
|---|
| 21 | },
|
|---|
| 22 | point: function(a, r) {
|
|---|
| 23 | this._curve.point(r * Math.sin(a), r * -Math.cos(a));
|
|---|
| 24 | }
|
|---|
| 25 | };
|
|---|
| 26 |
|
|---|
| 27 | export default function curveRadial(curve) {
|
|---|
| 28 |
|
|---|
| 29 | function radial(context) {
|
|---|
| 30 | return new Radial(curve(context));
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | radial._curve = curve;
|
|---|
| 34 |
|
|---|
| 35 | return radial;
|
|---|
| 36 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.