@code-not-art/core
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -29,8 +29,9 @@ import Vec2 from '../math/Vec2'; | ||
}): void; | ||
path({ path, fill, stroke, }: { | ||
path({ path, fill, stroke, cap, }: { | ||
path: Path; | ||
fill?: ColorSelection; | ||
stroke?: Stroke; | ||
cap?: 'round' | 'butt' | 'square'; | ||
}): void; | ||
} | ||
//# sourceMappingURL=Draw.d.ts.map |
@@ -76,3 +76,4 @@ "use strict"; | ||
var _this = this; | ||
var path = _a.path, fill = _a.fill, stroke = _a.stroke; | ||
var path = _a.path, fill = _a.fill, stroke = _a.stroke, cap = _a.cap; | ||
this.context.lineCap = cap || 'round'; | ||
this.context.beginPath(); | ||
@@ -79,0 +80,0 @@ this.context.moveTo(path.start.x, path.start.y); |
@@ -12,2 +12,4 @@ import { Vec2 } from '../math'; | ||
rotate: (radians: number) => CanvasTransform; | ||
flipHorizontal: () => CanvasTransform; | ||
flipVertical: () => CanvasTransform; | ||
}; | ||
@@ -14,0 +16,0 @@ declare class Canvas { |
@@ -115,2 +115,10 @@ "use strict"; | ||
}, | ||
flipHorizontal: function () { | ||
_this.context.scale(-1, 1); | ||
return _this.transform; | ||
}, | ||
flipVertical: function () { | ||
_this.context.scale(1, -1); | ||
return _this.transform; | ||
}, | ||
}; | ||
@@ -117,0 +125,0 @@ // ===== Get and Merge layers |
{ | ||
"name": "@code-not-art/core", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "HTML 5 Canvas Drawing Library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -107,2 +107,3 @@ import Vec2 from '../math/Vec2'; | ||
stroke, | ||
cap, | ||
}: { | ||
@@ -112,3 +113,5 @@ path: Path; | ||
stroke?: Stroke; | ||
cap?: 'round' | 'butt' | 'square'; | ||
}) { | ||
this.context.lineCap = cap || 'round'; | ||
this.context.beginPath(); | ||
@@ -115,0 +118,0 @@ this.context.moveTo(path.start.x, path.start.y); |
@@ -13,2 +13,4 @@ import { Vec2 } from '../math'; | ||
rotate: (radians: number) => CanvasTransform; | ||
flipHorizontal: () => CanvasTransform; | ||
flipVertical: () => CanvasTransform; | ||
}; | ||
@@ -158,2 +160,10 @@ | ||
}, | ||
flipHorizontal: (): CanvasTransform => { | ||
this.context.scale(-1, 1); | ||
return this.transform; | ||
}, | ||
flipVertical: (): CanvasTransform => { | ||
this.context.scale(1, -1); | ||
return this.transform; | ||
}, | ||
}; | ||
@@ -160,0 +170,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227270
124
3415