Browse Source

fix wrap calculation

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

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

@ -169,9 +169,16 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup @@ -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;

Loading…
Cancel
Save