Skip to content

Commit

Permalink
Rectpacking: Correctly set the default value for whitespace elimination.
Browse files Browse the repository at this point in the history
  • Loading branch information
soerendomroes committed Jul 16, 2024
1 parent 0a3412f commit a11c237
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ group whiteSpaceElimination {
description
"Strategy for expanding nodes such that whitespace in the parent is eliminated."
targets parents
default = WhiteSpaceEliminationStrategy.NONE
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,23 @@
*
*/
public enum WhiteSpaceEliminationStrategy implements ILayoutPhaseFactory<RectPackingLayoutPhases, ElkNode> {
/**
* The packing that is divided into rows, stacks, blocks, and subrows equally divides available space between this
* structures by moving the structures and the rectangles before expanding the rectangles such that all gaps are
* filled.
* The size of the parent remains unchanged.
*/
EQUAL_BETWEEN_STRUCTURES,
TO_ASPECT_RATIO;
/**
* Same as the equal between structures but the strategy expands to the desired aspect ratio.
* Hence, this increases the size of the parent.
*/
TO_ASPECT_RATIO,
/**
* Explicitly set that no whitespace elimination is done.
* This can be done explicitly, since some language do not support the use of null.
*/
NONE;

/* (non-Javadoc)
* @see org.eclipse.elk.core.alg.ILayoutPhaseFactory#create()
Expand All @@ -32,6 +47,7 @@ public ILayoutPhase<RectPackingLayoutPhases, ElkNode> create() {
return new EqualWhitespaceEliminator();
case TO_ASPECT_RATIO:
return new ToAspectratioNodeExpander();
case NONE:
default:
return null;
}
Expand Down

0 comments on commit a11c237

Please sign in to comment.