Fix available space calculation in Dialog_Partition_New::set_data()
The available number of sectors 'total_length' is calculated as one
sector too few. However this doesn't matter because when composing a
new partition in Dialog_Partition_New::Get_New_Partition() the dialog
fits the end of the partition to the end of the unallocated partition
'new_partition->sector_end' in which it is being created, not the
available space. Missed in earlier commit:
4f84cff781
cleanups
Anyway correct the calculation.
This commit is contained in:
parent
3a53d17c8d
commit
c8b4df5879
|
@ -183,7 +183,7 @@ void Dialog_Partition_New::set_data( const Device & device,
|
||||||
//set some widely used values...
|
//set some widely used values...
|
||||||
MIN_SPACE_BEFORE_MB = Dialog_Base_Partition::MB_Needed_for_Boot_Record( selected_partition );
|
MIN_SPACE_BEFORE_MB = Dialog_Base_Partition::MB_Needed_for_Boot_Record( selected_partition );
|
||||||
START = selected_partition.sector_start;
|
START = selected_partition.sector_start;
|
||||||
total_length = selected_partition.sector_end - selected_partition.sector_start;
|
total_length = selected_partition.get_sector_length();
|
||||||
TOTAL_MB = Utils::round( Utils::sector_to_unit( selected_partition.get_sector_length(),
|
TOTAL_MB = Utils::round( Utils::sector_to_unit( selected_partition.get_sector_length(),
|
||||||
selected_partition.sector_size, UNIT_MIB ) );
|
selected_partition.sector_size, UNIT_MIB ) );
|
||||||
MB_PER_PIXEL = TOTAL_MB / 500.00 ;
|
MB_PER_PIXEL = TOTAL_MB / 500.00 ;
|
||||||
|
|
Loading…
Reference in New Issue