GP-755 - Function Graph - fixed bug that caused preferred width of some

nodes to get incorrectly calculated

Closes #1008
This commit is contained in:
dragonmacher
2021-03-08 11:59:09 -05:00
parent c905c203f0
commit bba3218d69

View File

@@ -141,6 +141,7 @@ public class FGVertexListingPanel extends ListingPanel {
@Override
public Dimension getPreferredSize() {
Dimension preferredSize = super.getPreferredSize();
if (preferredSize.equals(lastParentPreferredSize) && preferredSizeCache != null) {
return preferredSizeCache;
@@ -164,8 +165,8 @@ public class FGVertexListingPanel extends ListingPanel {
private List<Layout> getAllLayouts(LayoutModel layoutModel) {
List<Layout> list = new ArrayList<>();
Layout layout = layoutModel.getLayout(BigInteger.ZERO);
BigInteger index = BigInteger.ONE;
BigInteger index = BigInteger.ZERO;
Layout layout = layoutModel.getLayout(index);
while (layout != null) {
list.add(layout);
index = layoutModel.getIndexAfter(index);