Skip to content

Commit 14b19de

Browse files
committed
Fix Scaling issues
Scaling issues when selecting genomes in the phylogeny and when loading a new file are resolved. Genome selection is still broken after loading a new file.
1 parent f6874ac commit 14b19de

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/main/java/gui/controllers/ribbon/RibbonController.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,19 @@ public void changed(ObservableValue<? extends Number> observable,
246246
scrollPane.setHvalue(scroll);
247247
}
248248
);
249+
addBindings();
250+
}
251+
252+
private void addBindings() {
253+
minScaleProperty.unbind();
254+
innerGroup.scaleYProperty().unbind();
255+
innerGroup.scaleXProperty().unbind();
249256

250-
double maxY = dbm.getDbReader().getMaxYCoord();
251257
minScaleProperty.bind(scrollPane.widthProperty()
252-
.divide(outerGroup.boundsInLocalProperty().get().getWidth()));
253-
254-
innerGroup.scaleYProperty().bind(scrollPane.heightProperty().divide(maxY));
258+
.divide(innerGroup.boundsInLocalProperty().get().getWidth()));
259+
double groupHeight = innerGroup.getBoundsInLocal().getHeight();
260+
innerGroup.scaleYProperty().bind(scrollPane.heightProperty().divide(groupHeight));
255261
innerGroup.scaleXProperty().bind(minScaleProperty.add(scaleOffSetProperty));
256-
257262
}
258263

259264

@@ -267,6 +272,8 @@ public void updateView() {
267272
innerGroup = new Group(collapsedGroup);
268273
outerGroup = new Group(innerGroup);
269274
scrollPane.setContent(outerGroup);
275+
276+
addBindings();
270277
}
271278

272279
public void redraw() {

0 commit comments

Comments
 (0)