Add tiled watermark layout support with adjustable gaps and UI controls

This commit is contained in:
alam00000 committed 2026-08-16 12:40:55 +05:30
1 parent 5bf54f1dad
commit 9635c398d6
7 files changed
+871 -23

No files matched your search

+19
View File
@@ -46,6 +46,18 @@ export class WatermarkNode extends BaseWorkflowNode {
'position',
new ClassicPreset.InputControl('text', { initial: 'center' })
);
this.addControl(
'tile',
new ClassicPreset.InputControl('text', { initial: 'no' })
);
this.addControl(
'tileGapX',
new ClassicPreset.InputControl('number', { initial: 25 })
);
this.addControl(
'tileGapY',
new ClassicPreset.InputControl('number', { initial: 75 })
);
this.addControl(
'pages',
new ClassicPreset.InputControl('text', { initial: 'all' })
@@ -96,6 +108,10 @@ export class WatermarkNode extends BaseWorkflowNode {
const posKey = getText('position', 'center').trim().toLowerCase();
const { x, y } = positionPresets[posKey] ?? positionPresets['center'];
const tile = getText('tile', 'no').trim().toLowerCase() === 'yes';
const tileGapX = Math.max(0, getNum('tileGapX', 25)) / 100;
const tileGapY = Math.max(0, getNum('tileGapY', 75)) / 100;
const pagesStr = getText('pages', 'all').trim().toLowerCase();
const shouldFlatten =
getText('flatten', 'no').trim().toLowerCase() === 'yes';
@@ -117,6 +133,9 @@ export class WatermarkNode extends BaseWorkflowNode {
x,
y: 1 - y,
pageIndices,
tile,
tileGapX,
tileGapY,
});
if (shouldFlatten) {