From e7e08ff29493f5e9762b52484d7b234c14f05ad2 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Mon, 10 Mar 2014 08:32:14 +0100 Subject: Fixes issue #274 --- .../query/client/plugins/effects/TransitionsAnimation.java | 12 ++++++++++-- .../com/google/gwt/query/client/GQueryEffectsTestGwt.java | 12 ++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java index 74353323..df3da8f3 100755 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java @@ -162,9 +162,17 @@ public class TransitionsAnimation extends PropertiesAnimation { if (part1 != null && !part1.isEmpty()) { double n = "-=".equals(part1) ? -1 : 1; - double st = Double.parseDouble(trsStart); + + double st = 0; + MatchResult sparts = REGEX_SYMBOL_NUMBER_UNIT.exec(trsStart); + if (sparts != null) { + st = Double.parseDouble(sparts.getGroup(2)); + unit = sparts.getGroup(3).isEmpty() ? unit : sparts.getGroup(3); + } + trsStart = "" + st + unit; + double en = Double.parseDouble(trsEnd); - trsEnd = "" + (st + (n*en)); + trsEnd = "" + (st + n*en) + unit; } // Deal with non px units like "%" diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEffectsTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEffectsTestGwt.java index ac79febe..11669ba4 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEffectsTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEffectsTestGwt.java @@ -23,8 +23,10 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.query.client.GQuery.Offset; import com.google.gwt.query.client.plugins.effects.Fx.ColorFx; +import com.google.gwt.query.client.plugins.effects.Fx.TransitFx; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.EasingCurve; +import com.google.gwt.query.client.plugins.effects.TransitionsAnimation; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Label; @@ -369,6 +371,16 @@ public class GQueryEffectsTestGwt extends GWTTestCase { }; timer.schedule(duration * 2); } + + public void testComputeFxPropTransitions() { + $(e).html("
AB
"); + $("#idtest").css("position", "absolute").find("td"); + final GQuery g = $("#idtest td"); + + TransitFx fx = (TransitFx)TransitionsAnimation.computeFxProp(g.get(0), "width", "+=100", false); + assertEquals("10px", fx.transitStart.replace(".0","")); + assertEquals("110px", fx.transitEnd.replace(".0","")); + } public void testStop() { $(e) -- cgit v1.2.3 From 83f7c26cfdcd19a079a88a7c7803f9e5f334c4bb Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Mon, 10 Mar 2014 08:32:44 +0100 Subject: Changing versio so as we can release 1.4.1 --- archetype/pom.xml | 2 +- archetype/src/main/resources/archetype-resources/pom.xml | 2 +- devtest/pom.xml | 2 +- gwtquery-core/pom.xml | 4 ++-- jsquery/pom.xml | 2 +- pom.xml | 2 +- samples/pom.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/archetype/pom.xml b/archetype/pom.xml index 94d53b52..aeefd7c9 100644 --- a/archetype/pom.xml +++ b/archetype/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.googlecode.gwtquery gquery-archetype - 1.4.1-SNAPSHOT + 1.4.1 maven-archetype GwtQuery Archetype diff --git a/archetype/src/main/resources/archetype-resources/pom.xml b/archetype/src/main/resources/archetype-resources/pom.xml index f61084a9..da695ebf 100644 --- a/archetype/src/main/resources/archetype-resources/pom.xml +++ b/archetype/src/main/resources/archetype-resources/pom.xml @@ -12,7 +12,7 @@ UTF-8 1.6 1.6 - 1.4.1-SNAPSHOT + 1.4.1 2.5.1 2.5.1 diff --git a/devtest/pom.xml b/devtest/pom.xml index 64ec23e6..4da27e99 100644 --- a/devtest/pom.xml +++ b/devtest/pom.xml @@ -5,7 +5,7 @@ com.googlecode.gwtquery gwtquery-project - 1.4.1-SNAPSHOT + 1.4.1 devtest diff --git a/gwtquery-core/pom.xml b/gwtquery-core/pom.xml index 1514e2e5..31aede2d 100644 --- a/gwtquery-core/pom.xml +++ b/gwtquery-core/pom.xml @@ -3,12 +3,12 @@ com.googlecode.gwtquery gwtquery-project - 1.4.1-SNAPSHOT + 1.4.1 gwtquery jar - 1.4.1-SNAPSHOT + 1.4.1 Gwt Query Core API http://gquery.org diff --git a/jsquery/pom.xml b/jsquery/pom.xml index 6feb3851..d71041cf 100644 --- a/jsquery/pom.xml +++ b/jsquery/pom.xml @@ -3,7 +3,7 @@ com.googlecode.gwtquery gwtquery-project - 1.4.1-SNAPSHOT + 1.4.1 JsQuery diff --git a/pom.xml b/pom.xml index e0ad1c67..ccf7fc60 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.googlecode.gwtquery gwtquery-project pom - 1.4.1-SNAPSHOT + 1.4.1 Gwt Query Project http://gwtquery.com GwtQuery is a jQuery clone written in GWT. diff --git a/samples/pom.xml b/samples/pom.xml index 18c15f14..c648e28b 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -3,7 +3,7 @@ com.googlecode.gwtquery gwtquery-project - 1.4.1-SNAPSHOT + 1.4.1 GwtQuery Samples -- cgit v1.2.3