add support for floating drawings
- added need elements and test for them
This commit is contained in:
33
src/file/drawing/text-wrap/wrap-tight.ts
Normal file
33
src/file/drawing/text-wrap/wrap-tight.ts
Normal file
@ -0,0 +1,33 @@
|
||||
// http://officeopenxml.com/drwPicFloating-textWrap.php
|
||||
import { XmlComponent, XmlAttributeComponent } from "file/xml-components";
|
||||
import { Distance } from "../drawing";
|
||||
|
||||
interface IWrapTightAttributes {
|
||||
distT?: number;
|
||||
distB?: number;
|
||||
}
|
||||
|
||||
class WrapTightAttributes extends XmlAttributeComponent<IWrapTightAttributes> {
|
||||
protected xmlKeys = {
|
||||
distT: "distT",
|
||||
distB: "distB",
|
||||
};
|
||||
}
|
||||
|
||||
export class WrapTight extends XmlComponent {
|
||||
constructor(distanceFromText?: Distance) {
|
||||
super("wp:wrapTight");
|
||||
|
||||
distanceFromText = distanceFromText || {
|
||||
distT: 0,
|
||||
distB: 0,
|
||||
};
|
||||
|
||||
this.root.push(
|
||||
new WrapTightAttributes({
|
||||
distT: distanceFromText.distT,
|
||||
distB: distanceFromText.distB,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user