HanSolo / medusa

A JavaFX library for Gauges
Apache License 2.0
694 stars 131 forks source link

Gauge Not Aligning in GridPane #219

Open cfbristow71 opened 2 years ago

cfbristow71 commented 2 years ago

Not sure this is an issue or by design, but I am currently using medusa gauges and running the 11.7 version. The reason for the old version is compatibility with the system I am running then on. Below is a snippet of code and it just seems to aligns to top and middle. image

gridPane.setAlignment(Pos.CENTER); Gauge gauge = new Gauge(); GridPane.setHalignment(gauge, HPos.LEFT); GridPane.setValignment(gauge, VPos.BOTTOM); gridPane.add(gauge,3, 2, 1, 1);

HanSolo commented 2 years ago

Sorry for the late reply, I’m currently a lot on the road but will take a look at it asap.

HanSolo commented 2 years ago

Ok, so I took a look at it and it is on purpose because you can define the startAngle and angle extend for the gauge. Meaning to say a gauge could also span a full circle so I always reserve the space for the full gauge, even if it is not used. The reason for this is it makes the whole resizing more simple.

cfbristow71 commented 2 years ago

Thanks for the quick response. Is there any way at to do alignment other than setting position manually. Some gauges seem to push against the right and some are centered. It seems almost random. For example, the image below has a setTranslateX and setTranslateY both set to 10, but it is clearly further than that away. Some other gauges have the same setting in a different grid cell and they are pushed to the right. Am I missing something in the way JavaFX coordinates work.

Edit: The gauge below uses the HSkin image