mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 640768 - Ensure thumbnails don't extend beyond content. [r=mfinkle]
This commit is contained in:
parent
4142440d41
commit
e48af138e9
@ -66,7 +66,17 @@
|
||||
let ratio = tabHeight / tabWidth;
|
||||
if (browser.contentDocumentWidth > 0)
|
||||
width = Math.min(width, browser.contentDocumentWidth);
|
||||
height = width * ratio;
|
||||
|
||||
if (browser.contentDocumentHeight > 0)
|
||||
height = Math.min(height, browser.contentDocumentHeight);
|
||||
|
||||
let newHeight = width * ratio;
|
||||
if (height >= newHeight) {
|
||||
height = newHeight;
|
||||
} else {
|
||||
// the browser aspect ratio does not match the tabs aspect ratio
|
||||
width = height / ratio;
|
||||
}
|
||||
|
||||
let thumbnail = this.thumbnail;
|
||||
thumbnail.removeAttribute("empty");
|
||||
|
Loading…
Reference in New Issue
Block a user