Merge branch 'master' of https://github.com/h4buli/docx into feat/h4-update
# Conflicts: # package.json # src/file/drawing/drawing.ts # src/file/media/media.ts # src/file/paragraph/run/picture-run.ts # src/file/styles/external-styles-factory.ts # src/file/xml-components/imported-xml-component.ts
This commit is contained in:
@ -1,31 +1,16 @@
|
||||
import { Drawing } from "../../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) {
|
||||
constructor(imageData: IMediaData, drawingOptions?: DrawingOptions) {
|
||||
super();
|
||||
|
||||
if (imageData === undefined) {
|
||||
throw new Error("imageData cannot be undefined");
|
||||
}
|
||||
|
||||
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);
|
||||
this.root.push(new Drawing(imageData, drawingOptions));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user