summaryrefslogtreecommitdiff
path: root/lib/GridFiller/Chooser/Smarter.pm
diff options
context:
space:
mode:
authorGianni Ceccarelli <dakkar@thenautilus.net>2010-12-26 16:59:19 +0000
committerGianni Ceccarelli <dakkar@thenautilus.net>2010-12-26 16:59:19 +0000
commit4bea68faa549c6725c4af9c94a3565d5bd78729a (patch)
tree58e69a65b8ffee0082e699226811be1c614d7ef6 /lib/GridFiller/Chooser/Smarter.pm
parentadd missing dep (diff)
downloadqr-builder-4bea68faa549c6725c4af9c94a3565d5bd78729a.tar.gz
qr-builder-4bea68faa549c6725c4af9c94a3565d5bd78729a.tar.bz2
qr-builder-4bea68faa549c6725c4af9c94a3565d5bd78729a.zip
string length may depend on direction
Diffstat (limited to 'lib/GridFiller/Chooser/Smarter.pm')
-rw-r--r--lib/GridFiller/Chooser/Smarter.pm10
1 files changed, 7 insertions, 3 deletions
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;