Added proper handling of items that begin late and end early.

This commit is contained in:
rainbow napkin 2025-02-09 17:29:07 -05:00
parent 330c4c275b
commit 179a10fb72
5 changed files with 286 additions and 69 deletions

View file

@ -553,7 +553,19 @@ class canopyUXUtils{
}
fixCutoff(standalone = true, pageBreak = document.body.scrollWidth - document.body.getBoundingClientRect().width){
fixCutoff(standalone = true, pageBreak){
//If we have no pagebreak
if(pageBreak == null){
//If we have a document body
if(document.body != null){
pageBreak = document.body.scrollWidth - document.body.getBoundingClientRect().width
//Otherwise
}else{
//Pretend nothing happened because we probably have bigger issues then a fucked up click-dragger cutoff
return;
}
}
//Fix the page width
if(this.flex){
this.element.style.flexBasis = `${this.calcWidth(this.element.getBoundingClientRect().width + pageBreak)}vw`;