From fbff7491dfb94fc6cf881d29dbe6c403ce80605a Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Mon, 25 Oct 2021 18:43:17 +0200 Subject: [PATCH] Zoom x 2 thumbnail cowebsite --- front/src/WebRtc/CoWebsiteManager.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/front/src/WebRtc/CoWebsiteManager.ts b/front/src/WebRtc/CoWebsiteManager.ts index 0b2dc17d..ff3ea1b1 100644 --- a/front/src/WebRtc/CoWebsiteManager.ts +++ b/front/src/WebRtc/CoWebsiteManager.ts @@ -298,10 +298,17 @@ class CoWebsiteManager { private setIframeOffset(coWebsite: CoWebsite, slot: CoWebsiteSlot) { const bounding = slot.container.getBoundingClientRect(); - coWebsite.iframe.style.top = bounding.top + 'px'; - coWebsite.iframe.style.left = bounding.left + 'px'; - coWebsite.iframe.style.width = (bounding.right - bounding.left) + 'px'; - coWebsite.iframe.style.height = (bounding.bottom - bounding.top) + 'px'; + if (coWebsite.iframe.classList.contains('thumbnail')) { + coWebsite.iframe.style.width = ((bounding.right - bounding.left) * 2) + 'px'; + coWebsite.iframe.style.height = ((bounding.bottom - bounding.top) * 2) + 'px'; + coWebsite.iframe.style.top = (bounding.top - (Math.floor(bounding.height * 0.5))) + 'px'; + coWebsite.iframe.style.left = (bounding.left - (Math.floor(bounding.width * 0.5))) + 'px'; + } else { + coWebsite.iframe.style.top = bounding.top + 'px'; + coWebsite.iframe.style.left = bounding.left + 'px'; + coWebsite.iframe.style.width = (bounding.right - bounding.left) + 'px'; + coWebsite.iframe.style.height = (bounding.bottom - bounding.top) + 'px'; + } } private resizeAllIframes() { @@ -338,6 +345,12 @@ class CoWebsiteManager { coWebsite.iframe.classList.remove('sub-main'); } + if (newPosition >= 2) { + coWebsite.iframe.classList.add('thumbnail'); + } else { + coWebsite.iframe.classList.remove('thumbnail'); + } + coWebsite.position = newPosition; if (oldSlot && !this.getCoWebsiteByPosition(oldSlot.position)) {