Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8428160b

Von Sven Schöling vor fast 9 Jahren hinzugefügt

  • ID 8428160bc31b5484bd6343313eabc03a69a1afd9
  • Vorgänger 375c7e54
  • Nachfolger 53b59449

PDF::Table: Proportional skalieren statt adaptiv

Unterschiede anzeigen:

modules/override/PDF/Table.pm
891 891
        $calc_widths->[$j] = $col_props->[$j]->{min_w} || 0;;
892 892
    }
893 893

  
894
    # Allow columns to expand to max_w before applying extra space equally.
895
    my $is_last_iter;
896
    for (;;)
897
    {
898
        my $span = ($avail_width - $min_width) / scalar( @$col_props);
899
        last if $span <= 0;
900

  
901
        $min_width = 0;
902
        my $next_will_be_last_iter = 1;
903
        for(my $j = 0; $j < scalar(@$col_props); $j++ )
904
        {
905
            my $new_w = $calc_widths->[$j] + $span;
906

  
907
            if (!$is_last_iter && $new_w > $col_props->[$j]->{max_w})
908
            {
909
                $new_w = $col_props->[$j]->{max_w}
910
            }
911
            if ($calc_widths->[$j] != $new_w )
912
            {
913
                $calc_widths->[$j] = $new_w;
914
                $next_will_be_last_iter = 0;
915
            }
916
            $min_width += $new_w;
917
        }
918
        last if $is_last_iter;
919
        $is_last_iter = $next_will_be_last_iter;
894
    my $span = 0;
895
    # Calculate how much can be added to every column to fit the available width
896
    $span = ($avail_width - $min_width) / scalar( @$col_props);
897
    for (my $j = 0; $j < scalar(@$col_props); $j++ ) {
898
      $calc_widths->[$j] = $col_props->[$j]->{min_w} + $span;
920 899
    }
921 900

  
922 901
    return ($calc_widths,$avail_width);

Auch abrufbar als: Unified diff