fix wrap calculation

This commit is contained in:
yggverse 2024-07-30 02:02:53 +03:00
parent 1a3c66f336
commit 4e565a72b2

View file

@ -169,9 +169,16 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup
{
foreach (explode(' ', $string) as $word)
{
if (isset($words[$line]) && self::_width(implode(' ', $words[$line])) > $width)
if (isset($words[$line]))
{
$line++;
$try = implode(
' ' , $words[$line]
) . ' ' . $word;
if (self::_width($try) > $width)
{
$line++;
}
}
$words[$line][] = $word;