# compensate discrepancy between textual length and rendered-html length sub Graph::Easy::Node::dimensions { # Returns the minimum dimensions of the node/cell derived from the # label or name, in characters. my $self = shift; use HTML::Strip; my $hs = HTML::Strip->new(); my $align = $self->attribute('align'); my ($lines,$aligns) = $self->_aligned_label($align); my $w = 0; my $h = scalar @$lines; foreach my $line (@$lines){ $line = $hs->parse($line); # $line =~ s/\s+/ /g; $w = length($line); # if length($line) > $w; } ($w,$h); }