From 9305fba822686c1177e4c8ae6172f9234713c4db Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 28 Oct 2009 15:51:42 +0000 Subject: fix partition width ratio computing (previous one included one extra separator width) --- perl-install/fs/partitioning_wizard.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index da1830753..124b77ab2 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -294,7 +294,11 @@ sub create_display_box { my $display_box = ugtk2::gtkset_size_request(Gtk2::HBox->new(0,0), -1, 26); - my $ratio = $totalsectors ? ($width - @parts * ($minwidth+1)) / $totalsectors : 1; + my $sep_count = @parts - 1; + #- ratio used to compute initial partition pixel width (each partition should be > min_width) + #- though, the pixel/sectors ratio can not be the same for all the partitions + my $initial_ratio = $totalsectors ? ($width - @parts * $min_width - $sep_count) / $totalsectors : 1; + my $ration = $initial_ratio; while (1) { my $totalwidth = sum(map { $_->{size} * $ratio + $minwidth } @parts); $totalwidth <= $width and last; -- cgit v1.2.1