@@ -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