|
@@ -114,7 +114,6 @@ export class SSvgPaintEngine extends SPaintEngine {
|
|
|
*/
|
|
|
drawRect(rect: SRect): void {
|
|
|
this._builder.append(
|
|
|
-
|
|
|
`<rect x="${rect.x}" y="${rect.y}" width="${rect.width}" height="${
|
|
|
rect.height
|
|
|
}" ${this.getStyle(true, true, false)} ${this.getSvgMatrix()}/>`
|
|
@@ -201,7 +200,6 @@ export class SSvgPaintEngine extends SPaintEngine {
|
|
|
* @param path 路径
|
|
|
*/
|
|
|
drawPath(path: SPath): void {
|
|
|
-
|
|
|
// `<path d="${path.svgPath()}" ${this.getStyle(
|
|
|
// true,
|
|
|
// true,
|
|
@@ -244,7 +242,20 @@ export class SSvgPaintEngine extends SPaintEngine {
|
|
|
width?: number,
|
|
|
height?: number
|
|
|
): void {
|
|
|
- // TODO: 未完成
|
|
|
+ // @ts-ignore
|
|
|
+ if (img.src) {
|
|
|
+ // @ts-ignore
|
|
|
+ let url = img.src;
|
|
|
+ url = url.replace(/\&/g, "&");
|
|
|
+ url = url.replace(/\</g, "<");
|
|
|
+ url = url.replace(/\>/g, ">");
|
|
|
+ url = url.replace(/\'/g, "'");
|
|
|
+ url = url.replace(/\"/g, """);
|
|
|
+ this._builder.append(
|
|
|
+ // eslint-disable-next-line max-len
|
|
|
+ `<image xlink:href="${url}" width="${width}" height="${height}" x="${x}" y="${y}" ${this.getSvgMatrix()} />`
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|