Add back scale functionality
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
import { Drawing } from "../../drawing";
|
||||
import { DrawingOptions } from "../../drawing/drawing";
|
||||
import { IMediaData } from "../../media/data";
|
||||
import { Run } from "../run";
|
||||
import { DrawingOptions } from "../../drawing/drawing";
|
||||
|
||||
export class PictureRun extends Run {
|
||||
private drawing: Drawing;
|
||||
|
||||
constructor(imageData: IMediaData, drawingOptions?: DrawingOptions) {
|
||||
super();
|
||||
|
||||
@ -11,6 +13,20 @@ export class PictureRun extends Run {
|
||||
throw new Error("imageData cannot be undefined");
|
||||
}
|
||||
|
||||
this.root.push(new Drawing(imageData, drawingOptions));
|
||||
this.drawing = new Drawing(imageData, drawingOptions);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user