summaryrefslogtreecommitdiffstats
path: root/o3d/samples/hud-2d-overlay.html
diff options
context:
space:
mode:
authorvangelis@google.com <vangelis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 21:32:53 +0000
committervangelis@google.com <vangelis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 21:32:53 +0000
commit944a14b8d46e63e603850c6c8b0d0638dc492a14 (patch)
tree077f0a20158509141e6834fc689d68f7f3322a9c /o3d/samples/hud-2d-overlay.html
parent67cbb7c11b0d0fd884d0644709b790cdd0339eb2 (diff)
downloadchromium_src-944a14b8d46e63e603850c6c8b0d0638dc492a14.zip
chromium_src-944a14b8d46e63e603850c6c8b0d0638dc492a14.tar.gz
chromium_src-944a14b8d46e63e603850c6c8b0d0638dc492a14.tar.bz2
Modified the hud-2d-overlay sample to reset the icon transforms and prevent
them from moving when running the selenium tests in order to get consistent snapshots. Review URL: http://codereview.chromium.org/155928 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/hud-2d-overlay.html')
-rw-r--r--o3d/samples/hud-2d-overlay.html21
1 files changed, 13 insertions, 8 deletions
diff --git a/o3d/samples/hud-2d-overlay.html b/o3d/samples/hud-2d-overlay.html
index 49c114b..0b86b34 100644
--- a/o3d/samples/hud-2d-overlay.html
+++ b/o3d/samples/hud-2d-overlay.html
@@ -389,14 +389,19 @@ function onrender(renderEvent) {
[0, 0, 0], // target
[0, 1, 0]); // up
- // Rotate/Scale the selected icon.
- var icon = g_icons[g_selectedIndex];
- icon.transform.identity();
- icon.transform.translate(
- 634 + 6 + 64, 17 + g_selectedIndex * 140 + 5 + 64, -1);
- icon.transform.rotateZ(g_clock * -1);
- var scale = Math.sin(g_clock * 15) * 0.1 + 0.7;
- icon.transform.scale(scale, scale, 1);
+ for (var i = 0; i < g_icons.length; i++) {
+ var icon = g_icons[i];
+ icon.transform.identity();
+ icon.transform.translate(
+ 634 + 6 + 64, 17 + i * 140 + 5 + 64, -1);
+ if (i == g_selectedIndex) {
+ icon.transform.rotateZ(g_clock * -1);
+ var scale = Math.sin(g_clock * 15) * 0.1 + 0.7;
+ icon.transform.scale(scale, scale, 1);
+ } else {
+ icon.transform.scale(0.8, 0.8, 0);
+ }
+ }
// Adjust the gauges
for (var ii = 0; ii < 3; ++ii) {