mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
after some more thought, I've decided to remove the Plugins namespace, but keep the plugins directory. I don't want 3rd parties putting some things in the Kinetic namespace, while others put things in the Plugin space. I really don't see a real need for the namespacing. For organizational purposes, the plugins directory still makes sense, however.
This commit is contained in:
parent
3c63b13c95
commit
5192ccd954
@ -31,7 +31,6 @@ var Kinetic = {};
|
||||
|
||||
// namespaces without constructors
|
||||
Kinetic.Filters = {};
|
||||
Kinetic.Plugins = {};
|
||||
Kinetic.DD = {};
|
||||
|
||||
// global namespace
|
||||
|
@ -31,11 +31,11 @@
|
||||
* @param {Number} [config.text.lineHeight] default is 1
|
||||
* {{NodeParams}}
|
||||
*/
|
||||
Kinetic.Plugins.Label = function(config) {
|
||||
Kinetic.Label = function(config) {
|
||||
this._initLabel(config);
|
||||
};
|
||||
|
||||
Kinetic.Plugins.Label.prototype = {
|
||||
Kinetic.Label.prototype = {
|
||||
_initLabel: function(config) {
|
||||
var that = this,
|
||||
text = null;
|
||||
@ -45,7 +45,7 @@
|
||||
Kinetic.Group.call(this, config);
|
||||
text = new Kinetic.Text(config.text);
|
||||
this.setText(text);
|
||||
this.setRect(new Kinetic.Plugins.LabelRect(config.rect));
|
||||
this.setRect(new Kinetic.LabelRect(config.rect));
|
||||
this.innerGroup.add(this.getRect());
|
||||
this.innerGroup.add(text);
|
||||
this.add(this.innerGroup);
|
||||
@ -102,15 +102,15 @@
|
||||
}
|
||||
};
|
||||
|
||||
Kinetic.Global.extend(Kinetic.Plugins.Label, Kinetic.Group);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.Label, 'text');
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.Label, 'rect');
|
||||
Kinetic.Global.extend(Kinetic.Label, Kinetic.Group);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Label, 'text');
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Label, 'rect');
|
||||
|
||||
Kinetic.Plugins.LabelRect = function(config) {
|
||||
Kinetic.LabelRect = function(config) {
|
||||
this._initLabelRect(config);
|
||||
};
|
||||
|
||||
Kinetic.Plugins.LabelRect.prototype = {
|
||||
Kinetic.LabelRect.prototype = {
|
||||
_initLabelRect: function(config) {
|
||||
this.createAttrs();
|
||||
Kinetic.Shape.call(this, config);
|
||||
@ -165,9 +165,9 @@
|
||||
}
|
||||
};
|
||||
|
||||
Kinetic.Global.extend(Kinetic.Plugins.LabelRect, Kinetic.Shape);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.LabelRect, 'pointerDirection', NONE);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.LabelRect, 'pointerWidth', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.LabelRect, 'pointerHeight', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.LabelRect, 'cornerRadius', 0);
|
||||
Kinetic.Global.extend(Kinetic.LabelRect, Kinetic.Shape);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.LabelRect, 'pointerDirection', NONE);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.LabelRect, 'pointerWidth', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.LabelRect, 'pointerHeight', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.LabelRect, 'cornerRadius', 0);
|
||||
})();
|
@ -9,11 +9,11 @@
|
||||
* {{ShapeParams}}
|
||||
* {{NodeParams}}
|
||||
*/
|
||||
Kinetic.Plugins.Path = function(config) {
|
||||
Kinetic.Path = function(config) {
|
||||
this._initPath(config);
|
||||
};
|
||||
|
||||
Kinetic.Plugins.Path.prototype = {
|
||||
Kinetic.Path.prototype = {
|
||||
_initPath: function(config) {
|
||||
this.dataArray = [];
|
||||
var that = this;
|
||||
@ -23,9 +23,9 @@
|
||||
this.shapeType = 'Path';
|
||||
this._setDrawFuncs();
|
||||
|
||||
this.dataArray = Kinetic.Plugins.Path.parsePathData(this.attrs.data);
|
||||
this.dataArray = Kinetic.Path.parsePathData(this.attrs.data);
|
||||
this.on('dataChange', function() {
|
||||
that.dataArray = Kinetic.Plugins.Path.parsePathData(that.attrs.data);
|
||||
that.dataArray = Kinetic.Path.parsePathData(that.attrs.data);
|
||||
});
|
||||
},
|
||||
drawFunc: function(canvas) {
|
||||
@ -72,16 +72,16 @@
|
||||
canvas.fillStroke(this);
|
||||
}
|
||||
};
|
||||
Kinetic.Global.extend(Kinetic.Plugins.Path, Kinetic.Shape);
|
||||
Kinetic.Global.extend(Kinetic.Path, Kinetic.Shape);
|
||||
|
||||
/*
|
||||
* Utility methods written by jfollas to
|
||||
* handle length and point measurements
|
||||
*/
|
||||
Kinetic.Plugins.Path.getLineLength = function(x1, y1, x2, y2) {
|
||||
Kinetic.Path.getLineLength = function(x1, y1, x2, y2) {
|
||||
return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
|
||||
};
|
||||
Kinetic.Plugins.Path.getPointOnLine = function(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
|
||||
Kinetic.Path.getPointOnLine = function(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
|
||||
if(fromX === undefined) {
|
||||
fromX = P1x;
|
||||
}
|
||||
@ -129,7 +129,7 @@
|
||||
return pt;
|
||||
};
|
||||
|
||||
Kinetic.Plugins.Path.getPointOnCubicBezier = function(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {
|
||||
Kinetic.Path.getPointOnCubicBezier = function(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {
|
||||
function CB1(t) {
|
||||
return t * t * t;
|
||||
}
|
||||
@ -150,7 +150,7 @@
|
||||
y: y
|
||||
};
|
||||
};
|
||||
Kinetic.Plugins.Path.getPointOnQuadraticBezier = function(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
|
||||
Kinetic.Path.getPointOnQuadraticBezier = function(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
|
||||
function QB1(t) {
|
||||
return t * t;
|
||||
}
|
||||
@ -168,7 +168,7 @@
|
||||
y: y
|
||||
};
|
||||
};
|
||||
Kinetic.Plugins.Path.getPointOnEllipticalArc = function(cx, cy, rx, ry, theta, psi) {
|
||||
Kinetic.Path.getPointOnEllipticalArc = function(cx, cy, rx, ry, theta, psi) {
|
||||
var cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);
|
||||
var pt = {
|
||||
x: rx * Math.cos(theta),
|
||||
@ -185,7 +185,7 @@
|
||||
* L data for the purpose of high performance Path
|
||||
* rendering
|
||||
*/
|
||||
Kinetic.Plugins.Path.parsePathData = function(data) {
|
||||
Kinetic.Path.parsePathData = function(data) {
|
||||
// Path Data Segment must begin with a moveTo
|
||||
//m (x y)+ Relative moveTo (subsequent points are treated as lineTo)
|
||||
//M (x y)+ Absolute moveTo (subsequent points are treated as lineTo)
|
||||
@ -422,9 +422,9 @@
|
||||
|
||||
return ca;
|
||||
};
|
||||
Kinetic.Plugins.Path.calcLength = function(x, y, cmd, points) {
|
||||
Kinetic.Path.calcLength = function(x, y, cmd, points) {
|
||||
var len, p1, p2;
|
||||
var path = Kinetic.Plugins.Path;
|
||||
var path = Kinetic.Path;
|
||||
|
||||
switch (cmd) {
|
||||
case 'L':
|
||||
@ -486,7 +486,7 @@
|
||||
|
||||
return 0;
|
||||
};
|
||||
Kinetic.Plugins.Path.convertEndpointToCenterParameterization = function(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) {
|
||||
Kinetic.Path.convertEndpointToCenterParameterization = function(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) {
|
||||
// Derived from: http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
|
||||
var psi = psiDeg * (Math.PI / 180.0);
|
||||
var xp = Math.cos(psi) * (x1 - x2) / 2.0 + Math.sin(psi) * (y1 - y2) / 2.0;
|
||||
@ -543,7 +543,7 @@
|
||||
return [cx, cy, rx, ry, theta, dTheta, psi, fs];
|
||||
};
|
||||
// add getters setters
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.Path, 'data');
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Path, 'data');
|
||||
|
||||
/**
|
||||
* set SVG path data string. This method
|
||||
@ -551,13 +551,13 @@
|
||||
* into a data array. Currently supported SVG data:
|
||||
* M, m, L, l, H, h, V, v, Q, q, T, t, C, c, S, s, A, a, Z, z
|
||||
* @name setData
|
||||
* @methodOf Kinetic.Plugins.Path.prototype
|
||||
* @methodOf Kinetic.Path.prototype
|
||||
* @param {String} SVG path command string
|
||||
*/
|
||||
|
||||
/**
|
||||
* get SVG path data string
|
||||
* @name getData
|
||||
* @methodOf Kinetic.Plugins.Path.prototype
|
||||
* @methodOf Kinetic.Path.prototype
|
||||
*/
|
||||
})();
|
||||
|
@ -9,11 +9,11 @@
|
||||
* {{ShapeParams}}
|
||||
* {{NodeParams}}
|
||||
*/
|
||||
Kinetic.Plugins.RegularPolygon = function(config) {
|
||||
Kinetic.RegularPolygon = function(config) {
|
||||
this._initRegularPolygon(config);
|
||||
};
|
||||
|
||||
Kinetic.Plugins.RegularPolygon.prototype = {
|
||||
Kinetic.RegularPolygon.prototype = {
|
||||
_initRegularPolygon: function(config) {
|
||||
this.createAttrs();
|
||||
|
||||
@ -36,35 +36,35 @@
|
||||
canvas.fillStroke(this);
|
||||
}
|
||||
};
|
||||
Kinetic.Global.extend(Kinetic.Plugins.RegularPolygon, Kinetic.Shape);
|
||||
Kinetic.Global.extend(Kinetic.RegularPolygon, Kinetic.Shape);
|
||||
|
||||
// add getters setters
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.RegularPolygon, 'radius', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.RegularPolygon, 'sides', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.RegularPolygon, 'radius', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.RegularPolygon, 'sides', 0);
|
||||
|
||||
/**
|
||||
* set radius
|
||||
* @name setRadius
|
||||
* @methodOf Kinetic.Plugins.RegularPolygon.prototype
|
||||
* @methodOf Kinetic.RegularPolygon.prototype
|
||||
* @param {Number} radius
|
||||
*/
|
||||
|
||||
/**
|
||||
* set number of sides
|
||||
* @name setSides
|
||||
* @methodOf Kinetic.Plugins.RegularPolygon.prototype
|
||||
* @methodOf Kinetic.RegularPolygon.prototype
|
||||
* @param {int} sides
|
||||
*/
|
||||
|
||||
/**
|
||||
* get radius
|
||||
* @name getRadius
|
||||
* @methodOf Kinetic.Plugins.RegularPolygon.prototype
|
||||
* @methodOf Kinetic.RegularPolygon.prototype
|
||||
*/
|
||||
|
||||
/**
|
||||
* get number of sides
|
||||
* @name getSides
|
||||
* @methodOf Kinetic.Plugins.RegularPolygon.prototype
|
||||
* @methodOf Kinetic.RegularPolygon.prototype
|
||||
*/
|
||||
})();
|
||||
|
@ -10,11 +10,11 @@
|
||||
* {{ShapeParams}}
|
||||
* {{NodeParams}}
|
||||
*/
|
||||
Kinetic.Plugins.Star = function(config) {
|
||||
Kinetic.Star = function(config) {
|
||||
this._initStar(config);
|
||||
};
|
||||
|
||||
Kinetic.Plugins.Star.prototype = {
|
||||
Kinetic.Star.prototype = {
|
||||
_initStar: function(config) {
|
||||
this.createAttrs();
|
||||
|
||||
@ -40,49 +40,49 @@
|
||||
canvas.fillStroke(this);
|
||||
}
|
||||
};
|
||||
Kinetic.Global.extend(Kinetic.Plugins.Star, Kinetic.Shape);
|
||||
Kinetic.Global.extend(Kinetic.Star, Kinetic.Shape);
|
||||
|
||||
// add getters setters
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.Star, 'numPoints', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.Star, 'innerRadius', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.Star, 'outerRadius', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Star, 'numPoints', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Star, 'innerRadius', 0);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Star, 'outerRadius', 0);
|
||||
|
||||
/**
|
||||
* set number of points
|
||||
* @name setNumPoints
|
||||
* @methodOf Kinetic.Plugins.Star.prototype
|
||||
* @methodOf Kinetic.Star.prototype
|
||||
* @param {Integer} points
|
||||
*/
|
||||
|
||||
/**
|
||||
* set outer radius
|
||||
* @name setOuterRadius
|
||||
* @methodOf Kinetic.Plugins.Star.prototype
|
||||
* @methodOf Kinetic.Star.prototype
|
||||
* @param {Number} radius
|
||||
*/
|
||||
|
||||
/**
|
||||
* set inner radius
|
||||
* @name setInnerRadius
|
||||
* @methodOf Kinetic.Plugins.Star.prototype
|
||||
* @methodOf Kinetic.Star.prototype
|
||||
* @param {Number} radius
|
||||
*/
|
||||
|
||||
/**
|
||||
* get number of points
|
||||
* @name getNumPoints
|
||||
* @methodOf Kinetic.Plugins.Star.prototype
|
||||
* @methodOf Kinetic.Star.prototype
|
||||
*/
|
||||
|
||||
/**
|
||||
* get outer radius
|
||||
* @name getOuterRadius
|
||||
* @methodOf Kinetic.Plugins.Star.prototype
|
||||
* @methodOf Kinetic.Star.prototype
|
||||
*/
|
||||
|
||||
/**
|
||||
* get inner radius
|
||||
* @name getInnerRadius
|
||||
* @methodOf Kinetic.Plugins.Star.prototype
|
||||
* @methodOf Kinetic.Star.prototype
|
||||
*/
|
||||
})();
|
||||
|
@ -16,7 +16,7 @@
|
||||
* {{ShapeParams}}
|
||||
* {{NodeParams}}
|
||||
*/
|
||||
Kinetic.Plugins.TextPath = function(config) {
|
||||
Kinetic.TextPath = function(config) {
|
||||
this._initTextPath(config);
|
||||
};
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
context.strokeText(this.partialText, 0, 0);
|
||||
}
|
||||
|
||||
Kinetic.Plugins.TextPath.prototype = {
|
||||
Kinetic.TextPath.prototype = {
|
||||
_initTextPath: function(config) {
|
||||
var that = this;
|
||||
|
||||
@ -46,9 +46,9 @@
|
||||
this.shapeType = 'TextPath';
|
||||
this._setDrawFuncs();
|
||||
|
||||
this.dataArray = Kinetic.Plugins.Path.parsePathData(this.attrs.data);
|
||||
this.dataArray = Kinetic.Path.parsePathData(this.attrs.data);
|
||||
this.on('dataChange', function() {
|
||||
that.dataArray = Kinetic.Plugins.Path.parsePathData(this.attrs.data);
|
||||
that.dataArray = Kinetic.Path.parsePathData(this.attrs.data);
|
||||
});
|
||||
// update text data for certain attr changes
|
||||
var attrs = ['text', 'textStroke', 'textStrokeWidth'];
|
||||
@ -97,7 +97,7 @@
|
||||
/**
|
||||
* get text width in pixels
|
||||
* @name getTextWidth
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
*/
|
||||
getTextWidth: function() {
|
||||
return this.textWidth;
|
||||
@ -105,7 +105,7 @@
|
||||
/**
|
||||
* get text height in pixels
|
||||
* @name getTextHeight
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
*/
|
||||
getTextHeight: function() {
|
||||
return this.textHeight;
|
||||
@ -113,7 +113,7 @@
|
||||
/**
|
||||
* set text
|
||||
* @name setText
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
* @param {String} text
|
||||
*/
|
||||
setText: function(text) {
|
||||
@ -201,8 +201,8 @@
|
||||
|
||||
switch (pathCmd.command) {
|
||||
case 'L':
|
||||
if(Kinetic.Plugins.Path.getLineLength(p0.x, p0.y, pathCmd.points[0], pathCmd.points[1]) > glyphWidth) {
|
||||
p1 = Kinetic.Plugins.Path.getPointOnLine(glyphWidth, p0.x, p0.y, pathCmd.points[0], pathCmd.points[1], p0.x, p0.y);
|
||||
if(Kinetic.Path.getLineLength(p0.x, p0.y, pathCmd.points[0], pathCmd.points[1]) > glyphWidth) {
|
||||
p1 = Kinetic.Path.getPointOnLine(glyphWidth, p0.x, p0.y, pathCmd.points[0], pathCmd.points[1], p0.x, p0.y);
|
||||
}
|
||||
else
|
||||
pathCmd = undefined;
|
||||
@ -227,7 +227,7 @@
|
||||
currentT = end;
|
||||
needNewSegment = true;
|
||||
}
|
||||
p1 = Kinetic.Plugins.Path.getPointOnEllipticalArc(pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3], currentT, pathCmd.points[6]);
|
||||
p1 = Kinetic.Path.getPointOnEllipticalArc(pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3], currentT, pathCmd.points[6]);
|
||||
break;
|
||||
case 'C':
|
||||
if(currentT === 0) {
|
||||
@ -245,7 +245,7 @@
|
||||
currentT = 1.0;
|
||||
needNewSegment = true;
|
||||
}
|
||||
p1 = Kinetic.Plugins.Path.getPointOnCubicBezier(currentT, pathCmd.start.x, pathCmd.start.y, pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3], pathCmd.points[4], pathCmd.points[5]);
|
||||
p1 = Kinetic.Path.getPointOnCubicBezier(currentT, pathCmd.start.x, pathCmd.start.y, pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3], pathCmd.points[4], pathCmd.points[5]);
|
||||
break;
|
||||
case 'Q':
|
||||
if(currentT === 0)
|
||||
@ -259,13 +259,13 @@
|
||||
currentT = 1.0;
|
||||
needNewSegment = true;
|
||||
}
|
||||
p1 = Kinetic.Plugins.Path.getPointOnQuadraticBezier(currentT, pathCmd.start.x, pathCmd.start.y, pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3]);
|
||||
p1 = Kinetic.Path.getPointOnQuadraticBezier(currentT, pathCmd.start.x, pathCmd.start.y, pathCmd.points[0], pathCmd.points[1], pathCmd.points[2], pathCmd.points[3]);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(p1 !== undefined) {
|
||||
currLen = Kinetic.Plugins.Path.getLineLength(p0.x, p0.y, p1.x, p1.y);
|
||||
currLen = Kinetic.Path.getLineLength(p0.x, p0.y, p1.x, p1.y);
|
||||
}
|
||||
|
||||
if(needNewSegment) {
|
||||
@ -282,7 +282,7 @@
|
||||
if(p0 === undefined || p1 === undefined)
|
||||
break;
|
||||
|
||||
var width = Kinetic.Plugins.Path.getLineLength(p0.x, p0.y, p1.x, p1.y);
|
||||
var width = Kinetic.Path.getLineLength(p0.x, p0.y, p1.x, p1.y);
|
||||
|
||||
// Note: Since glyphs are rendered one at a time, any kerning pair data built into the font will not be used.
|
||||
// Can foresee having a rough pair table built in that the developer can override as needed.
|
||||
@ -290,7 +290,7 @@
|
||||
var kern = 0;
|
||||
// placeholder for future implementation
|
||||
|
||||
var midpoint = Kinetic.Plugins.Path.getPointOnLine(kern + width / 2.0, p0.x, p0.y, p1.x, p1.y);
|
||||
var midpoint = Kinetic.Path.getPointOnLine(kern + width / 2.0, p0.x, p0.y, p1.x, p1.y);
|
||||
|
||||
var rotation = Math.atan2((p1.y - p0.y), (p1.x - p0.x));
|
||||
this.glyphInfo.push({
|
||||
@ -307,59 +307,59 @@
|
||||
};
|
||||
|
||||
// map TextPath methods to Text
|
||||
Kinetic.Plugins.TextPath.prototype._getContextFont = Kinetic.Text.prototype._getContextFont;
|
||||
Kinetic.TextPath.prototype._getContextFont = Kinetic.Text.prototype._getContextFont;
|
||||
|
||||
Kinetic.Global.extend(Kinetic.Plugins.TextPath, Kinetic.Shape);
|
||||
Kinetic.Global.extend(Kinetic.TextPath, Kinetic.Shape);
|
||||
|
||||
// add setters and getters
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.TextPath, 'fontFamily', CALIBRI);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.TextPath, 'fontSize', 12);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.Plugins.TextPath, 'fontStyle', NORMAL);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.TextPath, 'fontFamily', CALIBRI);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.TextPath, 'fontSize', 12);
|
||||
Kinetic.Node.addGetterSetter(Kinetic.TextPath, 'fontStyle', NORMAL);
|
||||
|
||||
Kinetic.Node.addGetter(Kinetic.Plugins.TextPath, 'text', EMPTY_STRING);
|
||||
Kinetic.Node.addGetter(Kinetic.TextPath, 'text', EMPTY_STRING);
|
||||
|
||||
/**
|
||||
* set font family
|
||||
* @name setFontFamily
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
* @param {String} fontFamily
|
||||
*/
|
||||
|
||||
/**
|
||||
* set font size
|
||||
* @name setFontSize
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
* @param {int} fontSize
|
||||
*/
|
||||
|
||||
/**
|
||||
* set font style. Can be 'normal', 'italic', or 'bold'. 'normal' is the default.
|
||||
* @name setFontStyle
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
* @param {String} fontStyle
|
||||
*/
|
||||
|
||||
/**
|
||||
* get font family
|
||||
* @name getFontFamily
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
*/
|
||||
|
||||
/**
|
||||
* get font size
|
||||
* @name getFontSize
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
*/
|
||||
|
||||
/**
|
||||
* get font style
|
||||
* @name getFontStyle
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
*/
|
||||
|
||||
/**
|
||||
* get text
|
||||
* @name getText
|
||||
* @methodOf Kinetic.Plugins.TextPath.prototype
|
||||
* @methodOf Kinetic.TextPath.prototype
|
||||
*/
|
||||
})();
|
||||
|
@ -331,7 +331,7 @@ Test.Modules.EVENTS = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
x: 200,
|
||||
y: 100,
|
||||
numPoints: 10,
|
||||
@ -404,7 +404,7 @@ Test.Modules.EVENTS = {
|
||||
var layer = new Kinetic.Layer({
|
||||
rotationDeg: 20
|
||||
});
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
x: 200,
|
||||
y: 100,
|
||||
numPoints: 10,
|
||||
@ -788,7 +788,7 @@ Test.Modules.DRAG_AND_DROP = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
x: 200,
|
||||
y: 100,
|
||||
numPoints: 5,
|
||||
|
@ -528,7 +528,7 @@ Test.Modules.PERFORMANCE = {
|
||||
|
||||
startTimer();
|
||||
for(var n = 0; n < 1000; n++) {
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
innerRadius: 20,
|
||||
outerRadius: 50,
|
||||
fill: 'yellow',
|
||||
@ -560,7 +560,7 @@ Test.Modules.PERFORMANCE = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
innerRadius: 20,
|
||||
outerRadius: 50,
|
||||
fill: 'yellow',
|
||||
|
@ -517,7 +517,7 @@ Test.Modules.CONTAINER = {
|
||||
fill: 'red'
|
||||
});
|
||||
|
||||
var textpath = new Kinetic.Plugins.TextPath({
|
||||
var textpath = new Kinetic.TextPath({
|
||||
y: 35,
|
||||
stroke: 'black',
|
||||
strokeWidth: 1,
|
||||
@ -528,7 +528,7 @@ Test.Modules.CONTAINER = {
|
||||
data: "M 10,10 300,150 550,150"
|
||||
});
|
||||
|
||||
var path = new Kinetic.Plugins.Path({
|
||||
var path = new Kinetic.Path({
|
||||
x: 200,
|
||||
y: -75,
|
||||
data: 'M200,100h100v50z',
|
||||
@ -541,7 +541,7 @@ Test.Modules.CONTAINER = {
|
||||
shadowOpacity: 0.5
|
||||
});
|
||||
|
||||
var poly = new Kinetic.Plugins.RegularPolygon({
|
||||
var poly = new Kinetic.RegularPolygon({
|
||||
x: stage.getWidth() / 2,
|
||||
y: stage.getHeight() / 2,
|
||||
sides: 5,
|
||||
|
@ -7,7 +7,7 @@ Test.Modules.LABEL = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var label = new Kinetic.Plugins.Label({
|
||||
var label = new Kinetic.Label({
|
||||
x: 100,
|
||||
y: 100,
|
||||
draggable: true,
|
||||
|
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@ Test.Modules.REGULAR_POLYGON = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var poly = new Kinetic.Plugins.RegularPolygon({
|
||||
var poly = new Kinetic.RegularPolygon({
|
||||
x: 200,
|
||||
y: 100,
|
||||
sides: 3,
|
||||
@ -36,7 +36,7 @@ Test.Modules.REGULAR_POLYGON = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var poly = new Kinetic.Plugins.RegularPolygon({
|
||||
var poly = new Kinetic.RegularPolygon({
|
||||
x: 200,
|
||||
y: 100,
|
||||
sides: 4,
|
||||
@ -58,7 +58,7 @@ Test.Modules.REGULAR_POLYGON = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var poly = new Kinetic.Plugins.RegularPolygon({
|
||||
var poly = new Kinetic.RegularPolygon({
|
||||
x: 200,
|
||||
y: 100,
|
||||
sides: 5,
|
||||
@ -80,7 +80,7 @@ Test.Modules.REGULAR_POLYGON = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var poly = new Kinetic.Plugins.RegularPolygon({
|
||||
var poly = new Kinetic.RegularPolygon({
|
||||
x: 200,
|
||||
y: 100,
|
||||
sides: 8,
|
||||
|
@ -7,7 +7,7 @@ Test.Modules.STAR = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
x: 200,
|
||||
y: 100,
|
||||
numPoints: 5,
|
||||
@ -48,7 +48,7 @@ Test.Modules.STAR = {
|
||||
fill: 'red'
|
||||
});
|
||||
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
x: 200,
|
||||
y: 100,
|
||||
numPoints: 5,
|
||||
|
File diff suppressed because one or more lines are too long
@ -220,7 +220,7 @@ Test.Modules.SHAPE = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
x: 200,
|
||||
y: 100,
|
||||
numPoints: 5,
|
||||
@ -628,7 +628,7 @@ Test.Modules.SHAPE = {
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var star = new Kinetic.Plugins.Star({
|
||||
var star = new Kinetic.Star({
|
||||
x: 200,
|
||||
y: 100,
|
||||
numPoints: 5,
|
||||
|
Loading…
Reference in New Issue
Block a user