BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/zdog/js
Run
Logout
Edit File
Size: 2.48 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/zdog/js/path-command.js
Text
Base64
/** * PathCommand */ ( function( root, factory ) { // module definition if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('./vector') ); } else { // browser global var Zdog = root.Zdog; Zdog.PathCommand = factory( Zdog.Vector ); } }( this, function factory( Vector ) { function PathCommand( method, points, previousPoint ) { this.method = method; this.points = points.map( mapVectorPoint ); this.renderPoints = points.map( mapNewVector ); this.previousPoint = previousPoint; this.endRenderPoint = this.renderPoints[ this.renderPoints.length - 1 ]; // arc actions come with previous point & corner point // but require bezier control points if ( method == 'arc' ) { this.controlPoints = [ new Vector(), new Vector() ]; } } function mapVectorPoint( point ) { if ( point instanceof Vector ) { return point; } else { return new Vector( point ); } } function mapNewVector( point ) { return new Vector( point ); } PathCommand.prototype.reset = function() { // reset renderPoints back to orignal points position var points = this.points; this.renderPoints.forEach( function( renderPoint, i ) { var point = points[i]; renderPoint.set( point ); } ); }; PathCommand.prototype.transform = function( translation, rotation, scale ) { this.renderPoints.forEach( function( renderPoint ) { renderPoint.transform( translation, rotation, scale ); } ); }; PathCommand.prototype.render = function( ctx, elem, renderer ) { return this[ this.method ]( ctx, elem, renderer ); }; PathCommand.prototype.move = function( ctx, elem, renderer ) { return renderer.move( ctx, elem, this.renderPoints[0] ); }; PathCommand.prototype.line = function( ctx, elem, renderer ) { return renderer.line( ctx, elem, this.renderPoints[0] ); }; PathCommand.prototype.bezier = function( ctx, elem, renderer ) { var cp0 = this.renderPoints[0]; var cp1 = this.renderPoints[1]; var end = this.renderPoints[2]; return renderer.bezier( ctx, elem, cp0, cp1, end ); }; var arcHandleLength = 9/16; PathCommand.prototype.arc = function( ctx, elem, renderer ) { var prev = this.previousPoint; var corner = this.renderPoints[0]; var end = this.renderPoints[1]; var cp0 = this.controlPoints[0]; var cp1 = this.controlPoints[1]; cp0.set( prev ).lerp( corner, arcHandleLength ); cp1.set( end ).lerp( corner, arcHandleLength ); return renderer.bezier( ctx, elem, cp0, cp1, end ); }; return PathCommand; } ) );
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 19
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
anchor.js
6.02 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
boilerplate.js
1.39 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
box.js
4.03 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
canvas-renderer.js
1.45 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cone.js
3.88 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
cylinder.js
4.25 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dragger.js
3.08 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ellipse.js
1.20 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
group.js
1.40 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
hemisphere.js
2.85 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
illustration.js
6.75 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.67 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
path-command.js
2.48 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
polygon.js
767 B
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rect.js
650 B
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
rounded-rect.js
1.51 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
shape.js
6.10 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
svg-renderer.js
1.83 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
vector.js
3.45 KB
lrw-r--r--
2025-03-28 11:04:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).