🚧 Last changes for pivot to JavaScript
This commit is contained in:
parent
9fbef27330
commit
27500d52e1
4 changed files with 10 additions and 5 deletions
|
@ -3,6 +3,7 @@ import attributes from "./attributes";
|
||||||
function path() {
|
function path() {
|
||||||
this.render = true;
|
this.render = true;
|
||||||
this.attributes = new attributes();
|
this.attributes = new attributes();
|
||||||
|
this.ops = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds a move operation to Point to */
|
/** Adds a move operation to Point to */
|
||||||
|
|
|
@ -35,6 +35,7 @@ export default function pattern(config = false) {
|
||||||
this.hooks = new hooks();
|
this.hooks = new hooks();
|
||||||
|
|
||||||
// Data containers
|
// Data containers
|
||||||
|
this.settings = {};
|
||||||
this.values = {};
|
this.values = {};
|
||||||
this.parts = {};
|
this.parts = {};
|
||||||
for (let id of config.parts) {
|
for (let id of config.parts) {
|
||||||
|
@ -53,7 +54,8 @@ export default function pattern(config = false) {
|
||||||
parts: this.parts,
|
parts: this.parts,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
values: this.values,
|
values: this.values,
|
||||||
config: this.config
|
config: this.config,
|
||||||
|
settings: this.settings
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,12 @@ point.prototype.rotate = function(deg, that) {
|
||||||
let x = that.x + radius * Math.cos(this.deg2rad(angle + deg)) * -1;
|
let x = that.x + radius * Math.cos(this.deg2rad(angle + deg)) * -1;
|
||||||
let y = that.y + radius * Math.sin(this.deg2rad(angle + deg));
|
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 */
|
/** returns an identical copy of this point */
|
||||||
point.prototype.copy = function() {
|
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 */
|
/** 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 */
|
/** Mirrors this point around X value of that point */
|
||||||
point.prototype.flipX = function(that) {
|
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 */
|
/** Mirrors this point around Y value of that point */
|
||||||
point.prototype.flipY = function(that) {
|
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 */
|
/** Shifts this point distance in the deg direction */
|
||||||
|
|
|
@ -5,6 +5,8 @@ import hooks from "./hooks";
|
||||||
import { version } from "../package.json";
|
import { version } from "../package.json";
|
||||||
|
|
||||||
function svg(pattern) {
|
function svg(pattern) {
|
||||||
|
this.openGroups = [];
|
||||||
|
this.freeId = 0;
|
||||||
this.body = "";
|
this.body = "";
|
||||||
this.style = "";
|
this.style = "";
|
||||||
this.script = "";
|
this.script = "";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue