summaryrefslogtreecommitdiff
path: root/lib/GridFiller/Result/Pango.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/GridFiller/Result/Pango.pm')
-rw-r--r--lib/GridFiller/Result/Pango.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/GridFiller/Result/Pango.pm b/lib/GridFiller/Result/Pango.pm
index 47a08c0..1172848 100644
--- a/lib/GridFiller/Result/Pango.pm
+++ b/lib/GridFiller/Result/Pango.pm
@@ -190,13 +190,13 @@ sub string_height {
}
sub _center_adj {
- my ($self,$p) = @_;
+ my ($self,$p,$space) = @_;
my ($w,$h) = $p->get_pixel_size;
my $size = $self->cell_size;
my $w_rounded = ceil($w/$size)*$size;
- my $w_adj = ceil(($w_rounded-$w)/2);
+ my $w_adj = ceil(($space*$size+$w_rounded-$w)/2);
my $h_adj = ceil(($size - $h)/2);
return $w_adj,$h_adj;
@@ -216,7 +216,7 @@ sub colour_for_string {
my $PI=3.1415926;
sub place_word_at {
- my ($self, $word, $x, $y, $dir) = @_;
+ my ($self, $word, $space, $x, $y, $dir) = @_;
$self->log->debug("Placing $word at ${x}:${y} ($dir)");
@@ -226,7 +226,7 @@ sub place_word_at {
my $cr = $self->_cairo_c;
$x*=$size;$y*=$size;
- my ($w_adjustment,$h_adjustment) = $self->_center_adj($p);
+ my ($w_adjustment,$h_adjustment) = $self->_center_adj($p,$space);
$cr->save;
if ($dir == $HORIZONTAL) {