From: Daniel Kirschten Date: Mon, 18 May 2020 16:55:14 +0000 (+0200) Subject: Fixed a bug in DoubleFieldEditor X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=d43177071628a87aa9e753d6432005bca259eb43;p=Mograsim.git Fixed a bug in DoubleFieldEditor Only the integral part of entered values was saved to the preferences --- diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/util/DoubleFieldEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/util/DoubleFieldEditor.java index acf99278..3641995f 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/util/DoubleFieldEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/util/DoubleFieldEditor.java @@ -59,7 +59,7 @@ public class DoubleFieldEditor extends StringFieldEditor * @param min the minimum allowed value (inclusive) * @param max the maximum allowed value (inclusive) */ - public void setValidRange(int min, int max) + public void setValidRange(double min, double max) { minValidValue = min; maxValidValue = max; @@ -131,7 +131,7 @@ public class DoubleFieldEditor extends StringFieldEditor if (text != null) { Double d = Double.valueOf(text.getText()); - getPreferenceStore().setValue(getPreferenceName(), d.intValue()); + getPreferenceStore().setValue(getPreferenceName(), d.doubleValue()); } }