From eeb2187db4f3c22eb7b6553edba1adf67631366a Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Mon, 13 Mar 2017 00:33:59 +0000 Subject: [PATCH] added source rectangle and stretch in the blip fill --- .../graphic/graphic-data/pic/blip/blip-fill.ts | 4 ++++ .../graphic-data/pic/blip/source-rectangle.ts | 8 ++++++++ .../graphic/graphic-data/pic/blip/stretch.ts | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts create mode 100644 ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts diff --git a/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts b/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts index 2b4370a58b..ac2ca1d580 100644 --- a/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts +++ b/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts @@ -1,10 +1,14 @@ import { XmlComponent } from "../../../../../../../../xml-components"; import { Blip } from "./blip"; +import { SourceRectangle } from "./source-rectangle"; +import { Stretch } from "./stretch"; export class BlipFill extends XmlComponent { constructor(referenceId: number) { super("pic:blipFill"); this.root.push(new Blip(referenceId)); + this.root.push(new SourceRectangle()); + this.root.push(new Stretch()); } } diff --git a/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts b/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts new file mode 100644 index 0000000000..32df3eaaac --- /dev/null +++ b/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts @@ -0,0 +1,8 @@ +import { XmlComponent } from "../../../../../../../../xml-components"; + +export class SourceRectangle extends XmlComponent { + + constructor() { + super("a:srcRect"); + } +} diff --git a/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts b/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts new file mode 100644 index 0000000000..c42fa04ff3 --- /dev/null +++ b/ts/docx/run/run-components/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts @@ -0,0 +1,16 @@ +import { XmlComponent } from "../../../../../../../../xml-components"; + +class FillRectangle extends XmlComponent { + + constructor() { + super("a:fillRect"); + } +} + +export class Stretch extends XmlComponent { + + constructor() { + super("a:stretch"); + this.root.push(new FillRectangle()); + } +}