PDF-Boxer

 view release on metacpan or  search on metacpan

lib/PDF/Boxer/Role/SizePosition.pm  view on Meta::CPAN

    }
  }

}

sub move{
  my ($self, $x, $y) = @_;
  return if 
    ($self->margin_left && $self->margin_left == $x)
    && ($self->margin_top && $self->margin_top == $y);
  warn $self->name." move $x, $y from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
  $self->adjust({ margin_left => $x, margin_top => $y });
}

sub set_width{
  my ($self, $arg) = @_;
  return if $self->width && $self->width == $arg;
  warn $self->name." set width $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
  $self->adjust({ width => $arg });
}

sub set_margin_width{
  my ($self, $arg) = @_;
  return if $self->margin_width && $self->margin_width == $arg;
  warn $self->name." set margin_width $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
  $self->adjust({ margin_width => $arg });
}

sub set_height{
  my ($self, $arg) = @_;
  return if $self->height && $self->height == $arg;
  warn $self->name." set height $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
  $self->adjust({ height => $arg });
}

sub set_margin_height{
  my ($self, $arg) = @_;
  return if $self->margin_height && $self->margin_height == $arg;
  warn $self->name." set margin_height $arg from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
  $self->adjust({ margin_height => $arg });
}

sub set_size{
  my ($self, $x, $y) = @_;
  return if 
    ($self->width && $self->width == $x)
    && ($self->height && $self->height == $y);
  warn $self->name." size $x, $y from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
  $self->adjust({ width => $x, height => $y });
}

sub set_margin_size{
  my ($self, $x, $y) = @_;
  return if $self->margin_width == $x && $self->margin_height == $y;
  warn $self->name." size $x, $y from ".join('-',(caller)[0,2])."\n" if $self->debug && $self->name;
  $self->adjust({ margin_width => $x, margin_height => $y });
}

sub child_height_set{};
sub child_width_set{};

sub position_set{
  my ($self) = @_;
  return 1 if ($self->has_margin_left || $self->has_margin_right)
           && ($self->has_margin_top || $self->has_margin_bottom);



( run in 2.634 seconds using v1.01-cache-2.11-cpan-a3c8064c92c )