1
0
Fork 0

🚧 Last changes for pivot to JavaScript

This commit is contained in:
Joost De Cock 2018-07-24 08:34:26 +02:00
parent 9fbef27330
commit 27500d52e1
4 changed files with 10 additions and 5 deletions

View file

@ -3,6 +3,7 @@ import attributes from "./attributes";
function path() {
this.render = true;
this.attributes = new attributes();
this.ops = [];
}
/** Adds a move operation to Point to */

View file

@ -35,6 +35,7 @@ export default function pattern(config = false) {
this.hooks = new hooks();
// Data containers
this.settings = {};
this.values = {};
this.parts = {};
for (let id of config.parts) {
@ -53,7 +54,8 @@ export default function pattern(config = false) {
parts: this.parts,
options: this.options,
values: this.values,
config: this.config
config: this.config,
settings: this.settings
};
}

View file

@ -66,12 +66,12 @@ point.prototype.rotate = function(deg, that) {
let x = that.x + radius * Math.cos(this.deg2rad(angle + deg)) * -1;
let y = that.y + radius * Math.sin(this.deg2rad(angle + deg));
return new Point(x, y);
return new point(x, y);
};
/** returns an identical copy of this point */
point.prototype.copy = function() {
return new Point(this.x, this.y);
return new point(this.x, this.y);
};
/** checks whether this point is equal to that point */
@ -81,12 +81,12 @@ point.prototype.equals = function(that) {
/** Mirrors this point around X value of that point */
point.prototype.flipX = function(that) {
return new Point(that.x + this.dx(that), that.y);
return new point(that.x + this.dx(that), that.y);
};
/** Mirrors this point around Y value of that point */
point.prototype.flipY = function(that) {
return new Point(that.x, that.y + this.dy(that));
return new point(that.x, that.y + this.dy(that));
};
/** Shifts this point distance in the deg direction */

View file

@ -5,6 +5,8 @@ import hooks from "./hooks";
import { version } from "../package.json";
function svg(pattern) {
this.openGroups = [];
this.freeId = 0;
this.body = "";
this.style = "";
this.script = "";