remove deprecated mutable drawing functions: scale, setXY
This commit is contained in:
@ -20,8 +20,4 @@ export class GraphicData extends XmlComponent {
|
||||
|
||||
this.root.push(this.pic);
|
||||
}
|
||||
|
||||
public setXY(x: number, y: number): void {
|
||||
this.pic.setXY(x, y);
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,6 @@ import { PicAttributes } from "./pic-attributes";
|
||||
import { ShapeProperties } from "./shape-properties/shape-properties";
|
||||
|
||||
export class Pic extends XmlComponent {
|
||||
private readonly shapeProperties: ShapeProperties;
|
||||
|
||||
constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
||||
super("pic:pic");
|
||||
|
||||
@ -19,14 +17,8 @@ export class Pic extends XmlComponent {
|
||||
}),
|
||||
);
|
||||
|
||||
this.shapeProperties = new ShapeProperties(transform);
|
||||
|
||||
this.root.push(new NonVisualPicProperties());
|
||||
this.root.push(new BlipFill(mediaData));
|
||||
this.root.push(new ShapeProperties(transform));
|
||||
}
|
||||
|
||||
public setXY(x: number, y: number): void {
|
||||
this.shapeProperties.setXY(x, y);
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,4 @@ export class Extents extends XmlComponent {
|
||||
|
||||
this.root.push(this.attributes);
|
||||
}
|
||||
|
||||
public setXY(x: number, y: number): void {
|
||||
this.attributes.set({
|
||||
cx: x,
|
||||
cy: y,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,4 @@ export class Form extends XmlComponent {
|
||||
this.root.push(new Offset());
|
||||
this.root.push(this.extents);
|
||||
}
|
||||
|
||||
public setXY(x: number, y: number): void {
|
||||
this.extents.setXY(x, y);
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,4 @@ export class ShapeProperties extends XmlComponent {
|
||||
// this.root.push(new NoFill());
|
||||
// this.root.push(new Outline());
|
||||
}
|
||||
|
||||
public setXY(x: number, y: number): void {
|
||||
this.form.setXY(x, y);
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,4 @@ export class Graphic extends XmlComponent {
|
||||
|
||||
this.root.push(this.data);
|
||||
}
|
||||
|
||||
public setXY(x: number, y: number): void {
|
||||
this.data.setXY(x, y);
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ export class Inline extends XmlComponent {
|
||||
private readonly extent: Extent;
|
||||
private readonly graphic: Graphic;
|
||||
|
||||
constructor(mediaData: IMediaData, private readonly transform: IMediaDataTransformation) {
|
||||
constructor(mediaData: IMediaData, transform: IMediaDataTransformation) {
|
||||
super("wp:inline");
|
||||
|
||||
this.root.push(
|
||||
@ -33,12 +33,4 @@ export class Inline extends XmlComponent {
|
||||
this.root.push(new GraphicFrameProperties());
|
||||
this.root.push(this.graphic);
|
||||
}
|
||||
|
||||
public scale(factorX: number, factorY: number): void {
|
||||
const newX = Math.round(this.transform.emus.x * factorX);
|
||||
const newY = Math.round(this.transform.emus.y * factorY);
|
||||
|
||||
this.extent.setXY(newX, newY);
|
||||
this.graphic.setXY(newX, newY);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user