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:
24
src/file/drawing/extent/extent.ts
Normal file
24
src/file/drawing/extent/extent.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { ExtentAttributes } from "./extent-attributes";
|
||||
|
||||
export class Extent extends XmlComponent {
|
||||
private attributes: ExtentAttributes;
|
||||
|
||||
constructor(x: number, y: number) {
|
||||
super("wp:extent");
|
||||
|
||||
this.attributes = new ExtentAttributes({
|
||||
cx: x,
|
||||
cy: y,
|
||||
});
|
||||
|
||||
this.root.push(this.attributes);
|
||||
}
|
||||
|
||||
public setXY(x: number, y: number): void {
|
||||
this.attributes.set({
|
||||
cx: x,
|
||||
cy: y,
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user