SourceTermAnalysisSystem_vue/node_modules/@antv/x6/lib/registry/background/flip-y.js
2026-05-15 10:22:44 +08:00

22 lines
636 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.flipY = void 0;
const flipY = function (img) {
// d d
// q q
const canvas = document.createElement('canvas');
const width = img.width;
const height = img.height;
canvas.width = width;
canvas.height = height * 2;
const ctx = canvas.getContext('2d');
// top image
ctx.drawImage(img, 0, 0, width, height);
// flipped bottom image
ctx.translate(0, 2 * height);
ctx.scale(1, -1);
ctx.drawImage(img, 0, 0, width, height);
return canvas;
};
exports.flipY = flipY;
//# sourceMappingURL=flip-y.js.map