Revert "fixes"

This reverts commit f5631a01ae.
This commit is contained in:
Alex McLean
2025-10-14 15:10:57 +01:00
parent a6c8c0814a
commit 481838c712
+12 -15
View File
@@ -6,7 +6,12 @@ export function textbox({ haps, ctx, id, margin = 10, fontsize = 24 } = {}) {
const h = ctx.canvas.height;
ctx.clearRect(0, 0, w, h);
const color = getTheme().foreground;
const centerX = w / 2;
const centerY = h / 2;
if (id) {
haps = haps.filter((hap) => hap.hasTag(id));
}
ctx.strokeStyle = color;
ctx.fillStyle = color;
ctx.globalAlpha = 1;
@@ -30,21 +35,13 @@ export function textbox({ haps, ctx, id, margin = 10, fontsize = 24 } = {}) {
Pattern.prototype.textbox = function (options = {}) {
let { ctx = getDrawContext(), id = 1 } = options;
this.draw(
(haps, time) => {
textbox({
...options,
time,
ctx,
haps: haps.filter((hap) => hap.isActive(time)),
});
},
{
lookbehind: 0,
lookahead: 0,
return this.tag(id).onPaint((_, time, haps) =>
textbox({
...options,
time,
ctx,
haps: haps.filter((hap) => hap.isActive(time)),
id,
},
}),
);
return this;
};