Add missing stage offset to tooltips

This commit is contained in:
chimp1984 2021-02-10 20:50:12 -05:00
parent 683e768a00
commit d04ac5cdf0
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -26,6 +26,7 @@ import bisq.core.locale.Res;
import bisq.common.UserThread;
import javafx.stage.PopupWindow;
import javafx.stage.Stage;
import javafx.scene.Node;
import javafx.scene.chart.Axis;
@ -524,8 +525,10 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
Node divider = dividerNodes.get(index);
Bounds bounds = divider.localToScene(divider.getBoundsInLocal());
Tooltip tooltip = dividerNodesTooltips.get(index);
double xOffset = index == 0 ? 75 : 0;
tooltip.show(divider, bounds.getMaxX() - xOffset, bounds.getMaxY() - 20);
double xOffset = index == 0 ? -90 : 10;
Stage stage = (Stage) root.getScene().getWindow();
tooltip.show(stage, stage.getX() + bounds.getMaxX() + xOffset,
stage.getY() + bounds.getMaxY() - 40);
}