Browse Source

fix wrap calculation

PHP-GTK3
yggverse 4 months ago
parent
commit
4e565a72b2
  1. 9
      src/Abstract/Model/Gtk/Pango/Markup.php

9
src/Abstract/Model/Gtk/Pango/Markup.php

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

Loading…
Cancel
Save