-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathutils.js
More file actions
21 lines (19 loc) · 599 Bytes
/
Copy pathutils.js
File metadata and controls
21 lines (19 loc) · 599 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var Overlap = require("overlap");
exports.overlap = function overlapCenter(background, text, y, x) {
if (typeof text === "string") {
return Overlap({
who: background
, with: text
, where: {
x: x === "center" ? background.split("\n")[0].length / 2 - text.length / 2 - 1 : x
, y: y
}
});
}
if (text.constructor === Array) {
for (var i = 0; i < text.length; ++i) {
background = overlapCenter(background, text[i], Number(y) + i, x);
}
return background;
}
};