Compare commits
1 Commits
master
...
fix/deploy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47aade71cf |
@ -302,12 +302,11 @@ export class RepoRenderer {
|
||||
// Watermark — tiled path text, 45° rotated, slightly larger than code font
|
||||
if (!tile.watermark) {
|
||||
const codeFontSize = (d.h / d.lines) * 0.65;
|
||||
// Clamp wmFontSize to avoid degenerate tiny values on files with huge line counts
|
||||
const wmFontSize = Math.max(codeFontSize * 2.5, 1.0);
|
||||
const wmFontSize = codeFontSize * 2.5;
|
||||
const wmLabel = `${this.repoName}/${d.path}`;
|
||||
// Estimate how many repetitions to fill the area; cap to prevent RangeError on massive tiles
|
||||
const charsPerLine = Math.min(Math.ceil(Math.max(d.w, d.h) * 1.5 / (wmFontSize * 0.5)), 400);
|
||||
const lineCount = Math.min(Math.ceil(Math.max(d.w, d.h) * 1.5 / (wmFontSize * 1.5)), 150);
|
||||
// Estimate how many repetitions to fill the area
|
||||
const charsPerLine = Math.ceil(Math.max(d.w, d.h) * 1.5 / (wmFontSize * 0.5));
|
||||
const lineCount = Math.ceil(Math.max(d.w, d.h) * 1.5 / (wmFontSize * 1.5));
|
||||
const wmContent = buildWatermark(wmLabel, charsPerLine, lineCount);
|
||||
|
||||
const wm = new Text();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user