From cccf763831eca0763025ac1788b477815d1fa600 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Fri, 13 Dec 2024 18:35:18 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20hide=20full=20screen=20button=20?= =?UTF-8?q?when=20not=20useful?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/grapher/src/core/Grapher.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index ab641b28e14..ecc0acf19bd 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -2419,9 +2419,10 @@ export class Grapher } @computed get hideFullScreenButton(): boolean { - const { windowInnerHeight } = this - if (!windowInnerHeight) return true - return this.windowInnerHeight! < this.frameBounds.height + // hide the full screen button if the full screen height + // is barely larger than the current chart height + const fullScreenHeight = this.windowInnerHeight! + return fullScreenHeight < this.frameBounds.height + 80 } @computed private get availableWidth(): number {