diff --git a/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/RectPacking.melk b/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/RectPacking.melk index cde949cc2..0a8a059f7 100644 --- a/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/RectPacking.melk +++ b/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/RectPacking.melk @@ -206,9 +206,9 @@ option inNewRow: boolean { } option orderBySize: boolean { - label "Order nodes by size" + label "Order nodes by height" description - "If set to true the nodes will be sorted by the size of their area before computing the layout. The largest + "If set to true the nodes will be sorted by their height before computing the layout. The highest node will be in the first position." default = false targets parents diff --git a/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/intermediate/NodeSizeComparator.java b/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/intermediate/NodeSizeComparator.java index 4466f4aaa..3da9c90eb 100644 --- a/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/intermediate/NodeSizeComparator.java +++ b/plugins/org.eclipse.elk.alg.rectpacking/src/org/eclipse/elk/alg/rectpacking/intermediate/NodeSizeComparator.java @@ -14,7 +14,7 @@ import org.eclipse.elk.graph.ElkNode; /** - * Node size comparator to compare nodes by their size + * Node size comparator to compare nodes by their height * */ public class NodeSizeComparator implements Comparator { @@ -24,10 +24,7 @@ public class NodeSizeComparator implements Comparator { */ @Override public int compare(ElkNode node0, ElkNode node1) { - double area0 = node0.getWidth() * node0.getHeight(); - double area1 = node1.getWidth() * node1.getHeight(); - - return Double.compare(area1, area0); + return Double.compare(node1.getHeight(), node0.getHeight()); } }