am 12290bd7: Fix coords of NeuralNetwork LW tap effects.
Merge commit '12290bd7369db1e81b2dd67be67ef0d4b292b412' into eclair-plus-aosp
* commit '12290bd7369db1e81b2dd67be67ef0d4b292b412':
Fix coords of NeuralNetwork LW tap effects.
diff --git a/res/raw/nexus.rs b/res/raw/nexus.rs
index 3b43411..b82a307 100644
--- a/res/raw/nexus.rs
+++ b/res/raw/nexus.rs
@@ -284,6 +284,7 @@
if (State->rotate) {
//matrixLoadRotate(matrix, 90.0f, 0.0f, 0.0f, 1.0f);
//matrixTranslate(matrix, 0.0f, -height, 1.0f);
+ // XXX: HAX: do not slide display in landscape
} else {
matrixTranslate(matrix, -(State->xOffset * width), 0, 0);
}
diff --git a/src/com/android/wallpaper/nexus/NexusRS.java b/src/com/android/wallpaper/nexus/NexusRS.java
index 6d5cce7..88f3a0e 100644
--- a/src/com/android/wallpaper/nexus/NexusRS.java
+++ b/src/com/android/wallpaper/nexus/NexusRS.java
@@ -105,7 +105,9 @@
@Override
public void resize(int width, int height) {
- super.resize(width, height);
+ super.resize(width, height); // updates mWidth, mHeight
+
+ // android.util.Log.d("NexusRS", String.format("resize(%d, %d)", width, height));
mWorldState.width = width;
mWorldState.height = height;
@@ -281,8 +283,15 @@
boolean resultRequested) {
final int dw = mWorldState.width;
- final int bw = 960;
- x = (int) (x + mWorldState.xOffset * (bw-dw));
+ final int bw = 960; // XXX: hardcoded width of background texture
+ if (mWorldState.rotate == 0) {
+ // nexus.rs ignores the xOffset when rotated; we shall endeavor to do so as well
+ x = (int) (x + mWorldState.xOffset * (bw-dw));
+ }
+
+ // android.util.Log.d("NexusRS", String.format(
+ // "dw=%d, bw=%d, xOffset=%g, x=%d",
+ // dw, bw, mWorldState.xOffset, x));
if ("android.wallpaper.tap".equals(action)) {
sendCommand(1, x, y);