Cleanup: comment length in interface

This commit is contained in:
2019-04-17 08:44:38 +02:00
parent 41d4a19865
commit 6b26024ea4
17 changed files with 203 additions and 132 deletions

View File

@@ -139,10 +139,11 @@ int ui_but_align_opposite_to_area_align_get(const ARegion *ar)
}
/**
* This function checks a pair of buttons (assumed in a same align group), and if they are neighbors,
* set needed data accordingly.
* This function checks a pair of buttons (assumed in a same align group),
* and if they are neighbors, set needed data accordingly.
*
* \note It is designed to be called in total random order of buttons. Order-based optimizations are done by caller.
* \note It is designed to be called in total random order of buttons.
* Order-based optimizations are done by caller.
*/
static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other)
{
@@ -268,13 +269,15 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other
* +-----------+
* </pre>
*
* Here, BUT 3 RIGHT side would not get 'dragged' to align with BUT 1 RIGHT side, since BUT 3 has not RIGHT neighbor.
* So, this function, when called with BUT 1, will 'walk' the whole column in \a side_s1 direction (TOP or DOWN when
* called for RIGHT side), and force buttons like BUT 3 to align as needed, if BUT 1 and BUT 3 were detected as needing
* top-right corner stitching in #block_align_proximity_compute() step.
* Here, BUT 3 RIGHT side would not get 'dragged' to align with BUT 1 RIGHT side,
* since BUT 3 has not RIGHT neighbor.
* So, this function, when called with BUT 1, will 'walk' the whole column in \a side_s1 direction
* (TOP or DOWN when called for RIGHT side), and force buttons like BUT 3 to align as needed,
* if BUT 1 and BUT 3 were detected as needing top-right corner stitching in
* #block_align_proximity_compute() step.
*
* \note To avoid doing this twice, some stitching flags are cleared to break the 'stitching connection'
* between neighbors.
* \note To avoid doing this twice, some stitching flags are cleared to break the
* 'stitching connection' between neighbors.
*/
static void block_align_stitch_neighbors(ButAlign *butal,
const int side,
@@ -290,16 +293,17 @@ static void block_align_stitch_neighbors(ButAlign *butal,
const int stitch_s1 = STITCH(side_s1);
const int stitch_s2 = STITCH(side_s2);
/* We have to check stitching flags on both sides of the stitching, since we only clear one of them flags to break
* any future loop on same 'columns/side' case.
* Also, if butal is spanning over several rows or columns of neighbors, it may have both of its stitching flags
/* We have to check stitching flags on both sides of the stitching,
* since we only clear one of them flags to break any future loop on same 'columns/side' case.
* Also, if butal is spanning over several rows or columns of neighbors,
* it may have both of its stitching flags
* set, but would not be the case of its immediate neighbor! */
while ((butal->flags[side] & stitch_s1) && (butal = butal->neighbors[side_s1]) &&
(butal->flags[side] & stitch_s2)) {
butal_neighbor = butal->neighbors[side];
/* If we actually do have a neighbor, we directly set its values accordingly, and clear its matching 'dist'
* to prevent it being set again later... */
/* If we actually do have a neighbor, we directly set its values accordingly,
* and clear its matching 'dist' to prevent it being set again later... */
if (butal_neighbor) {
butal->but->drawflag |= align;
butal_neighbor->but->drawflag |= align_opp;
@@ -389,7 +393,8 @@ static void ui_block_align_but_to_region(uiBut *but, const ARegion *region)
/**
* Compute the alignment of all 'align groups' of buttons in given block.
*
* This is using an order-independent algorithm, i.e. alignment of buttons should be OK regardless of order in which
* This is using an order-independent algorithm,
* i.e. alignment of buttons should be OK regardless of order in which
* they are added to the block.
*/
void ui_block_align_calc(uiBlock *block, const ARegion *region)
@@ -404,7 +409,8 @@ void ui_block_align_calc(uiBlock *block, const ARegion *region)
int side;
int i, j;
/* First loop: we count number of buttons belonging to an align group, and clear their align flag.
/* First loop: we count number of buttons belonging to an align group,
* and clear their align flag.
* Tabs get some special treatment here, they get aligned to region border. */
for (but = block->buttons.first; but; but = but->next) {
/* special case: tabs need to be aligned to a region border, drawflag tells which one */