medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Gauge Not Aligning in GridPane

Open cfbristow71 opened this issue 2 years ago • 3 comments

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);

cfbristow71 avatar Sep 26 '22 23:09 cfbristow71

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

HanSolo avatar Sep 28 '22 13:09 HanSolo

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.

HanSolo avatar Sep 28 '22 19:09 HanSolo

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

cfbristow71 avatar Sep 28 '22 20:09 cfbristow71