HanSolo / medusa

A JavaFX library for Gauges
Apache License 2.0
687 stars 129 forks source link

MaxValue rounded every time when it sets over 100 and wrong under 100. #177

Closed milosic5 closed 4 years ago

milosic5 commented 4 years ago

Hi there, I have problem with maxValue() and value() in this source code:

Gauge g = GaugeBuilder.create(). skinType(Gauge.SkinType.DASHBOARD). maxValue(15). value(15). maxWidth(300). maxHeight(200). unit("%"). build();

it rounds maxValue to 16 and shows it on screen. Also when I want to set maxValue over 100 it rounds it every time, for example if you set 860 for maxValue it rounds it to 900 ! I think this is big problem and hope you can fix it.

second first

HanSolo commented 4 years ago

Hmm...interesting, I use exactly your code:

gauge = GaugeBuilder.create()\
                    .skinType(Gauge.SkinType.DASHBOARD)\
                    .maxValue(15)\
                    .value(15)\
                    .maxWidth(300)\
                    .maxHeight(200)\
                    .unit("%")\
                    .build();

and the result looks as follows:

Test 2019-10-01 14-08-46

This is how it should look like right? This was tested on the latest release 11.2

milosic5 commented 4 years ago

Everything is ok when I put autoScale to false.

HanSolo commented 4 years ago

Well...that's what autoscale is for :)