fix: Remove text visibility bounds check

This commit is contained in:
DiTus
2026-03-21 23:59:37 +01:00
parent e3999e6506
commit f9eda9f18b

View File

@ -862,29 +862,11 @@ export class DrawingManager {
textY = d.alignVert === 'top' ? y - offset : (d.alignVert === 'bottom' ? y + offset : y); textY = d.alignVert === 'top' ? y - offset : (d.alignVert === 'bottom' ? y + offset : y);
} }
// Render Text if present and visible on screen
if (d.text && labelPos && labelPos.y >= 0 && labelPos.y <= scope.mediaSize.height) {
ctx.save();
ctx.setLineDash([]);
ctx.font = font;
ctx.fillStyle = d.textColor || d.color;
ctx.textAlign = d.alignHorz || 'center';
ctx.textBaseline = d.alignVert === 'middle' ? 'middle' : (d.alignVert === 'bottom' ? 'top' : 'bottom');
ctx.fillText(d.text, textX, textY);
ctx.restore();
}
// Store label position for hit detection
if (labelPos) {
d.labelPos = labelPos;
}
// Render Text if present // Render Text if present
if (d.text) { if (d.text) {
ctx.save(); ctx.save();
ctx.setLineDash([]); ctx.setLineDash([]);
ctx.font = `${fontStyle}${fontSize}px Inter`; ctx.font = font;
ctx.fillStyle = d.textColor || d.color; ctx.fillStyle = d.textColor || d.color;
ctx.textAlign = d.alignHorz || 'center'; ctx.textAlign = d.alignHorz || 'center';
@ -943,8 +925,8 @@ export class DrawingManager {
textY = d.alignVert === 'top' ? -offset : (d.alignVert === 'bottom' ? offset : 0); textY = d.alignVert === 'top' ? -offset : (d.alignVert === 'bottom' ? offset : 0);
} }
// Render Text if present and visible on screen // Render Text if present
if (d.text && labelPos && labelPos.y >= 0 && labelPos.y <= scope.mediaSize.height) { if (d.text) {
ctx.save(); ctx.save();
ctx.setLineDash([]); ctx.setLineDash([]);
ctx.font = font; ctx.font = font;