-
Notifications
You must be signed in to change notification settings - Fork 117
SD-2468 - fix: image not being contained within cell #2775
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5253,6 +5253,7 @@ export class DomPainter { | |
| // Position and z-index on the image only (not the line) so resize overlay can stack above. | ||
| img.style.position = 'relative'; | ||
| img.style.zIndex = '1'; | ||
| img.style.maxWidth = '100%'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tested this with the ticket's repro — this line doesn't run for e-sign signatures. they take a different route (line 5505), which already sets what's actually wrong is at const annotationWidth = textWidth + annotationHorizontalPadding;it sizes the cell from the label text ("Signature" ≈ 68px) and ignores the image. so the cell stays tiny and a real signature gets squeezed in. height has a special case at lines 1702-1711; width doesn't. was your repro a regular image rather than an e-sign signature?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @caio-pizzol thanks for the thoughtful review! The fix I am proposing here is specifically for signatures drawn on I just added a log there to validate. Let me know if you'd like to join on a call to take a look at it together! |
||
| } | ||
|
|
||
| // Apply rotation and flip transforms from OOXML a:xfrm | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Any thoughts on something that could break by changing this here? To me, this seems like the right approach because
maxWidthsimply tells the browser to not overflow the maximum allowed width, but it will still try to render the original size of the image. If the parent's size is smaller than the original image size, the image will be contained within.