Distributing elements

From TaskDepender
Jump to: navigation, search
(Design)
(Design)
Line 15: Line 15:
 
== Design ==
 
== Design ==
  
When distributing the elements evenly horizontally, the space between to adjacent elements must be equal. To calculate this value, the leftmost edge and the rightmost edge must be determined. This gives the total space to occupy. Next the total space occupied by the elements must be calculated. This is done by determining the sum of the widths of all the selected elements. Since for ''N'' selected elements there are ''N''-1 spaces, the value for the space between two adjacent elements is calculated by determining the difference between the rightmost edge and the leftmost edge minus the sum of the widths and dividing this value by ''N''-1.
+
When distributing the elements evenly horizontally, the space between to adjacent elements must be equal.
  
 
[[Image:Distribute.png]]
 
[[Image:Distribute.png]]
 +
 +
To calculate this value, the leftmost edge and the rightmost edge must be determined. This gives the total space to occupy. Next the total space occupied by the elements must be calculated. This is done by determining the sum of the widths of all the selected elements. Since for ''N'' selected elements there are ''N''-1 spaces, the value for the space between two adjacent elements is calculated by determining the difference between the rightmost edge and the leftmost edge minus the sum of the widths and dividing this value by ''N''-1.
 +
 +
  
 
Assuming that the space between two adjacent elements is ''s'', then a certain element ''i'' must be positioned at:
 
Assuming that the space between two adjacent elements is ''s'', then a certain element ''i'' must be positioned at:

Revision as of 19:01, 9 November 2011

Personal tools