summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/partitioning_wizard.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-10-28 15:51:42 +0000
committerOlivier Blin <oblin@mandriva.com>2009-10-28 15:51:42 +0000
commit9305fba822686c1177e4c8ae6172f9234713c4db (patch)
tree14084fd6ef26bc79e610b7ca7efe27acf3edfd57 /perl-install/fs/partitioning_wizard.pm
parentf8bb7913e2a6a73573e42b8f559656177ffe3892 (diff)
downloaddrakx-backup-do-not-use-9305fba822686c1177e4c8ae6172f9234713c4db.tar
drakx-backup-do-not-use-9305fba822686c1177e4c8ae6172f9234713c4db.tar.gz
drakx-backup-do-not-use-9305fba822686c1177e4c8ae6172f9234713c4db.tar.bz2
drakx-backup-do-not-use-9305fba822686c1177e4c8ae6172f9234713c4db.tar.xz
drakx-backup-do-not-use-9305fba822686c1177e4c8ae6172f9234713c4db.zip
fix partition width ratio computing (previous one included one extra separator width)
Diffstat (limited to 'perl-install/fs/partitioning_wizard.pm')
-rw-r--r--perl-install/fs/partitioning_wizard.pm6
1 files changed, 5 insertions, 1 deletions
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;