From 4bea68faa549c6725c4af9c94a3565d5bd78729a Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Sun, 26 Dec 2010 16:59:19 +0000 Subject: string length may depend on direction --- lib/GridFiller/Chooser/Smarter.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/GridFiller/Chooser/Smarter.pm') diff --git a/lib/GridFiller/Chooser/Smarter.pm b/lib/GridFiller/Chooser/Smarter.pm index 0abd088..16ed0b0 100644 --- a/lib/GridFiller/Chooser/Smarter.pm +++ b/lib/GridFiller/Chooser/Smarter.pm @@ -14,13 +14,17 @@ sub maxfirst { sub find_place_for { my ($self,$word) = @_; - my $length = $self->length->($word); - - $self->log->debug("looking for $length of space"); my @candidates; + my $length = $self->length->($word,$HORIZONTAL); + $self->log->debug("looking for $length of horizontal space"); + push @candidates, $self->_find_places_horiz($length); + + $length = $self->length->($word,$VERTICAL); + $self->log->debug("looking for $length of vertical space"); + push @candidates, $self->_find_places_vert($length); return unless @candidates; -- cgit v1.2.3