mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-04 03:34:28 +08:00
fix(autoscale): Apply vw when width and height are not present
This commit is contained in:
parent
c412267457
commit
0b4527bb03
1 changed files with 5 additions and 1 deletions
|
@ -28,8 +28,12 @@ function _runOnImageNode(node) {
|
|||
if (width && height && (widthUnits === heightUnits)) {
|
||||
node.style.maxWidth = '100vw';
|
||||
node.style.maxHeight = `${100 * height / width}vw`;
|
||||
} else if (width && !height) {
|
||||
} else if (!height) {
|
||||
node.style.maxWidth = '100vw';
|
||||
} else {
|
||||
// If your image has a width and height in different units, or a height and
|
||||
// no width, we don't want to screw with it because it would change the
|
||||
// aspect ratio.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue