🚧 Removed point proxy, plugins can decorate points
This commit is contained in:
parent
20e4ada666
commit
2e70a5bd8a
1 changed files with 1 additions and 15 deletions
16
lib/part.ts
16
lib/part.ts
|
@ -3,23 +3,10 @@ import { Path } from './path'
|
|||
import { Snippet } from './snippet'
|
||||
import { Attributes } from './attributes'
|
||||
|
||||
function PointProxy(id: string) {
|
||||
this.id = id;
|
||||
this.get = function(points: any, key: string, proxy: ProxyHandler<Map<any, any>>): Point {
|
||||
return points.get(key);
|
||||
};
|
||||
this.set = function(points: Map<string, Point>, key: string, point: Point, proxy: ProxyHandler<Map<any, any>>) {
|
||||
point.attributes.add('data-key', key);
|
||||
point.attributes.add('data-part', this.id);
|
||||
points.set(key, point);
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
export class Part {
|
||||
id: string;
|
||||
render: boolean;
|
||||
points: any;
|
||||
points: { [index: string]: Point; } = {};
|
||||
paths: { [index: string]: Path; } = {};
|
||||
snippets: { [index: string]: Snippet; } = {};
|
||||
attributes = new Attributes();
|
||||
|
@ -28,7 +15,6 @@ export class Part {
|
|||
constructor(id: string) {
|
||||
this.id = id;
|
||||
this.render = (id.substr(0,1) === '_') ? false : true;
|
||||
this.points = new Proxy(new Map(), new PointProxy(id));
|
||||
this.points.origin = new Point(0,0);
|
||||
|
||||
return this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue