svg-engine
Version:
Create SVG files in Node.js
33 lines • 1.02 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.XYPositioning = void 0;
const SVGInstance_js_1 = require("../../../node/instance/SVGInstance.js");
class XYPositioning extends SVGInstance_js_1.SVGInstance {
moveTo(x, y) {
this.attr("x", x);
this.attr("y", y);
return this;
}
moveBy(dx, dy) {
var _a, _b;
const x = (_a = this.attr("x")) !== null && _a !== void 0 ? _a : 0 + dx;
const y = (_b = this.attr("y")) !== null && _b !== void 0 ? _b : 0 + dy;
return this.moveTo(x, y);
}
x(x) {
if (typeof x === "string" || typeof x === "number") {
this.attr("x", x);
return this;
}
return this.attr("x");
}
y(y) {
if (typeof y === "string" || typeof y === "number") {
this.attr("y", y);
return this;
}
return this.attr("y");
}
}
exports.XYPositioning = XYPositioning;
//# sourceMappingURL=xyPositioning.js.map
;