-
Notifications
You must be signed in to change notification settings - Fork 46
fix: bug watermarks render darker than they should [SD-1469] #1737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: bug watermarks render darker than they should [SD-1469] #1737
Conversation
* 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
…-feature-render-watermarks
…-feature-render-watermarks
placement, cutting of text
There was a problem hiding this 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.
...c/core/super-converter/v3/handlers/w/pict/helpers/handle-shape-text-watermark-import.test.js
Outdated
Show resolved
Hide resolved
...or/src/core/super-converter/v3/handlers/w/pict/helpers/handle-shape-text-watermark-import.js
Show resolved
Hide resolved
...or/src/core/super-converter/v3/handlers/w/pict/helpers/handle-shape-text-watermark-import.js
Show resolved
Hide resolved
|
@harbournick Not sure how the commit about SD-58 ended up in here. I must have pulled it from main at one stage. |
harbournick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
## [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))
|
🎉 This PR is included in version 1.6.2-next.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This is a continuation of SD-851 and includes fixes of both image and text watermarks: