2017-12-19 23:13:11 +00:00
|
|
|
import { Drawing } from "../../drawing";
|
2018-06-09 23:49:01 +01:00
|
|
|
import { IDrawingOptions } from "../../drawing/drawing";
|
2017-12-30 21:18:55 +00:00
|
|
|
import { IMediaData } from "../../media/data";
|
2017-03-12 23:31:43 +00:00
|
|
|
import { Run } from "../run";
|
|
|
|
|
|
|
|
export class PictureRun extends Run {
|
2018-08-07 01:38:15 +01:00
|
|
|
private readonly drawing: Drawing;
|
2018-06-09 23:33:52 +01:00
|
|
|
|
2018-06-09 23:49:01 +01:00
|
|
|
constructor(imageData: IMediaData, drawingOptions?: IDrawingOptions) {
|
2019-06-17 01:51:57 +01:00
|
|
|
super({});
|
2017-04-01 12:18:23 +01:00
|
|
|
|
|
|
|
if (imageData === undefined) {
|
|
|
|
throw new Error("imageData cannot be undefined");
|
|
|
|
}
|
|
|
|
|
2018-06-09 23:33:52 +01:00
|
|
|
this.drawing = new Drawing(imageData, drawingOptions);
|
|
|
|
|
|
|
|
this.root.push(this.drawing);
|
|
|
|
}
|
|
|
|
|
2018-11-02 02:51:57 +00:00
|
|
|
public scale(factorX: number = 1, factorY: number = factorX): void {
|
2018-06-09 23:33:52 +01:00
|
|
|
this.drawing.scale(factorX, factorY);
|
2017-03-12 23:31:43 +00:00
|
|
|
}
|
|
|
|
}
|