Skip to content

Commit 8daf6f4

Browse files
committed
fix non-working fix for #6
1 parent 6485006 commit 8daf6f4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/uis/calendar.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class CalendarUI {
4949
*/
5050
private _eventFitsOnScreen(eventElement: HTMLDivElement | undefined = undefined): boolean {
5151
// Get required input
52-
const windowHeight = window.innerHeight * window.ui.scalingFactor;
52+
const availableWindowHeight = window.innerHeight;
5353
const infoBarHeight = parseInt(getComputedStyle(this._calendar).getPropertyValue('--header-footer-height')) * window.ui.scalingFactor;
5454
const calendarHeight = this._calendar.clientHeight * window.ui.scalingFactor;
5555
const eventHeight = 78 * window.ui.scalingFactor; // Assume every event takes up 78 pixels * UI scaling factor
@@ -59,15 +59,16 @@ export class CalendarUI {
5959
const requiredSpace = eventHeight + eventMargin;
6060

6161
// Calculate how much space is left on the screen
62-
const spaceLeft = windowHeight - calendarHeight - (infoBarHeight * 2) - (eventMargin * 2);
62+
const spaceLeft = availableWindowHeight - calendarHeight - (infoBarHeight * 2) - (eventMargin * 2);
6363

6464
console.debug("Calculated if event fits on screen",
65-
"windowHeight", windowHeight,
65+
"availableWindowHeight", availableWindowHeight,
6666
"calendarHeight", calendarHeight,
6767
"eventHeight", eventHeight,
6868
"eventMargin", eventMargin,
6969
"requiredSpace", requiredSpace,
70-
"spaceLeft", spaceLeft
70+
"spaceLeft", spaceLeft,
71+
"scalingFactor", window.ui.scalingFactor
7172
);
7273

7374
return requiredSpace < spaceLeft;

0 commit comments

Comments
 (0)