- /* get the default percentage */
- int children = con_num_children(first->parent);
- LOG("ins. %d children\n", children);
- double percentage = 1.0 / children;
- LOG("default percentage = %f\n", percentage);
-
- /* resize */
- LOG("second->percent = %f\n", second->percent);
- LOG("first->percent before = %f\n", first->percent);
- if (first->percent == 0.0)
- first->percent = percentage;
- if (second->percent == 0.0)
- second->percent = percentage;
- double new_first_percent = first->percent + ((double)ppt / 100.0);
- double new_second_percent = second->percent - ((double)ppt / 100.0);
- LOG("new_first_percent = %f\n", new_first_percent);
- LOG("new_second_percent = %f\n", new_second_percent);
- /* Ensure that the new percentages are positive and greater than
- * 0.05 to have a reasonable minimum size. */
- if (definitelyGreaterThan(new_first_percent, 0.05, DBL_EPSILON) &&
- definitelyGreaterThan(new_second_percent, 0.05, DBL_EPSILON)) {
- first->percent += ((double)ppt / 100.0);
- second->percent -= ((double)ppt / 100.0);
- LOG("first->percent after = %f\n", first->percent);
- LOG("second->percent after = %f\n", second->percent);
- } else {
- LOG("Not resizing, already at minimum size\n");