Fix page rendering when a leftbox is rendered
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 50s
Create Docker Image / Build Docker Image (arm64) (push) Successful in -16h54m16s
Create Docker Image / Final Docker Image Manifest (push) Successful in 12s

This commit is contained in:
Deon George 2024-09-08 21:23:11 +10:00
parent 7f95305d75
commit e6c0511b33

View File

@ -332,13 +332,13 @@ class Page
$subtext = substr($this->text,$current_pos,$space_pos);
}
// If the reset of the string will fit on the current line
} elseif ($text_length-$current_pos < static::MSG_WIDTH-$buffer) {
// If the rest of the string will fit on the current line
} elseif ($text_length-$current_pos < static::MSG_WIDTH-$this->x-$buffer) {
$subtext = substr($this->text,$current_pos);
// Get the next lines worth of chars, breaking on a space
} else {
$subtext = $this->text_substr(substr($this->text,$current_pos),static::MSG_WIDTH-$buffer);
$subtext = $this->text_substr(substr($this->text,$current_pos),static::MSG_WIDTH-$this->x-$buffer);
// Include the text up to the last space
if (substr($this->text,$current_pos+strlen($subtext),1) !== ' ')