Add scalable image feature

This commit is contained in:
Dolan
2018-03-24 19:06:10 +00:00
parent a954c69458
commit 05816abc12
15 changed files with 179 additions and 55 deletions

View File

@ -3,6 +3,8 @@ import { IMediaData } from "../../media/data";
import { Run } from "../run";
export class PictureRun extends Run {
private drawing: Drawing;
constructor(imageData: IMediaData) {
super();
@ -10,6 +12,20 @@ export class PictureRun extends Run {
throw new Error("imageData cannot be undefined");
}
this.root.push(new Drawing(imageData));
this.drawing = new Drawing(imageData);
this.root.push(this.drawing);
}
public scale(factorX: number, factorY?: number): void {
if (!factorX) {
factorX = 1;
}
if (!factorY) {
factorY = factorX;
}
this.drawing.scale(factorX, factorY);
}
}