Skip to content

Conversation

@johanneswilm
Copy link
Contributor

This is a continuation of SD-851 and includes fixes of both image and text watermarks:

  • Text watermarks: based on various example files, the rendering is now closer to what can be observed in word processors on average (although not 100% the same). This also includes documents in landscape mode.
  • Image watermarks: Conversion factors of gain and blacklevel have been adjusted in order to get closer to those values using within Word (also not 100% the same still).

johanneswilm and others added 7 commits January 10, 2026 16:13
* feat: added permStart/permEnd translators and schema

* chore: removed logs

* feat: allow editing sections with permStart/permEnd

* feat: added highlight for permStart/permEnd

* fix: show permStart/permEnd highlights in other document modes

* fix: edge cases

* refactor: removed unused class

* refactor: removed unused code

* fix: overlay styles

* refactor: removed unused code

* chore: change permission island background color

* feat: allow users in permStart/permEnd

* fix: infinite loop

* chore: small code tweaks

* chore: added docs

* chore: added docs

* refactor: rename functions

* chore: rename test

* chore: simplified code

* fix: tests

* fix: tests

* chore: removed unused fns
Copilot AI review requested due to automatic review settings January 14, 2026 14:59
@johanneswilm johanneswilm changed the title Sd 1469 bug watermarks render darker than they should SD-1469 bug watermarks render darker than they should Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes rendering issues with watermarks (both text and image) to more closely match their appearance in Microsoft Word. The changes adjust brightness/contrast conversion factors for image watermarks and modify text watermark rendering to prevent clipping through padding and layout adjustments.

Changes:

  • Modified image watermark brightness and contrast calculations to better match Word's rendering
  • Added 10% padding to text watermark SVG dimensions to prevent text clipping
  • Updated margin offset handling for center-aligned text watermarks to improve browser rendering
  • Removed hardcoded bold font-weight from text watermarks

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
packages/super-editor/src/extensions/index.js Added an empty line (likely unintentional whitespace)
packages/super-editor/src/core/super-converter/v3/handlers/w/pict/helpers/handle-shape-text-watermark-import.test.js Updated tests to account for 10% padding on dimensions and new margin offset behavior for center-aligned watermarks; added test for 345-degree rotation edge case
packages/super-editor/src/core/super-converter/v3/handlers/w/pict/helpers/handle-shape-text-watermark-import.js Added 10% padding to SVG dimensions, added overflow:visible style, removed bold font-weight, and conditionally zeroed horizontal margin offset for center-aligned watermarks
packages/layout-engine/painters/dom/src/renderer.ts Adjusted VML gain and blacklevel conversion factors for image watermarks (contrast multiplier changed to 2/3, brightness calculation changed from additive to multiplicative)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@johanneswilm
Copy link
Contributor Author

@harbournick Not sure how the commit about SD-58 ended up in here. I must have pulled it from main at one stage.

@harbournick harbournick changed the title SD-1469 bug watermarks render darker than they should fix: bug watermarks render darker than they should [SD-1469] Jan 14, 2026
Copy link
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harbournick harbournick merged commit 7ce423d into superdoc-dev:main Jan 14, 2026
3 of 4 checks passed
harbournick pushed a commit that referenced this pull request Jan 14, 2026
## [1.6.2-next.2](v1.6.2-next.1...v1.6.2-next.2) (2026-01-14)

### Bug Fixes

* bug watermarks render darker than they should [SD-1469] ([#1737](#1737)) ([7ce423d](7ce423d))
@harbournick
Copy link
Collaborator

🎉 This PR is included in version 1.6.2-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants