# HG changeset patch # User Sascha L. Teichmann # Date 1340632222 0 # Node ID 71db63f67d318b064b99657c342504278689ccf3 # Parent 96d02c6f44a2e46c51f6bc03cdb0868cfaaceeae FixA: Do not throw layout away if only the km chart needs reloading. flys-client/trunk@4777 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 96d02c6f44a2 -r 71db63f67d31 flys-client/ChangeLog --- a/flys-client/ChangeLog Sat Jun 23 08:16:40 2012 +0000 +++ b/flys-client/ChangeLog Mon Jun 25 13:50:22 2012 +0000 @@ -1,3 +1,9 @@ +2012-06-25 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java: + Do not throw layout away if only the km chart needs reloading. + Fix floating point vs. integer rounding issues. + 2012-06-23 Sascha L. Teichmann * src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java: diff -r 96d02c6f44a2 -r 71db63f67d31 flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java Sat Jun 23 08:16:40 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java Mon Jun 25 13:50:22 2012 +0000 @@ -235,18 +235,15 @@ km = 0; } art.getFilter().setCurrentKm(km); - if (chartContainer.hasMember(chartImg)) { - chartContainer.removeMember(chartImg); - } int hWidth = helperContainer.getWidth() - 12; int hHeight = helperContainer.getHeight() - 62; - if ((int)(hHeight *4/3) < hWidth) { - hWidth = (int)hHeight * 4/3; + if ((int)(hHeight *4f/3) < hWidth) { + hWidth = (int)(hHeight * 4f/3); } else { - hHeight = (int)hWidth *3/4; + hHeight = (int)(hWidth *3f/4); } String imgUrl = GWT.getModuleBaseURL(); @@ -254,9 +251,15 @@ imgUrl += "?locale=" + locale; imgUrl += "&filter=" + art.getFilter().getChartFilter(hWidth, hHeight); - chartImg = new Img(imgUrl, hWidth, hHeight); - chartContainer.addMember(chartImg); - + if (chartContainer.hasMember(chartImg)) { + chartImg.setWidth(hWidth); + chartImg.setHeight(hHeight); + chartImg.setSrc(imgUrl); + } + else { + chartImg = new Img(imgUrl, hWidth, hHeight); + chartContainer.addMember(chartImg); + } }