Preliminary support for svg rendering

This commit is contained in:
MoyuScript
2014-09-04 18:47:06 +03:00
parent 07fef3c04a
commit 6f35015b93
7 changed files with 62 additions and 20 deletions

View File

@@ -1,10 +1,11 @@
function Renderer(width, height, images) {
function Renderer(width, height, images, options) {
this.width = width;
this.height = height;
this.images = images;
this.options = options;
}
Renderer.prototype.renderImage = function(container, bounds, borderData, image) {
Renderer.prototype.renderImage = function(container, bounds, borderData, imageContainer) {
var paddingLeft = container.cssInt('paddingLeft'),
paddingTop = container.cssInt('paddingTop'),
paddingRight = container.cssInt('paddingRight'),
@@ -12,11 +13,11 @@ Renderer.prototype.renderImage = function(container, bounds, borderData, image)
borders = borderData.borders;
this.drawImage(
image,
imageContainer,
0,
0,
image.width,
image.height,
imageContainer.image.width,
imageContainer.image.height,
bounds.left + paddingLeft + borders[3].width,
bounds.top + paddingTop + borders[0].width,
bounds.width - (borders[1].width + borders[3].width + paddingLeft + paddingRight),