N°3448 - Framework field size check not correctly implemented for multibytes languages/strings (#528)

This commit is contained in:
Anne-Catherine
2024-01-15 16:10:23 +01:00
committed by GitHub
parent a8cd9566ac
commit cff50f8732
7 changed files with 207 additions and 70 deletions

View File

@@ -62,7 +62,7 @@ class DisplayableNode extends GraphNode
public function GetWidth()
{
return max(32, 5*strlen($this->GetProperty('label'))); // approximation of the text's bounding box
return max(32, 5 * mb_strlen($this->GetProperty('label'))); // approximation of the text's bounding box
}
public function GetHeight()
@@ -491,7 +491,7 @@ class DisplayableNode extends GraphNode
if ($bNoLabel)
{
// simulate a fake label with the approximate same size as the true label
$sLabel = str_repeat('x',strlen($this->GetProperty('label', $this->GetId())));
$sLabel = str_repeat('x', mb_strlen($this->GetProperty('label', $this->GetId())));
$sDot = 'label="'.$sLabel.'"';
}
else