diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-28 00:25:46 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-28 00:25:46 +0000 |
commit | b09288b78170b9b9d9691e7ae208a376547ea5d7 (patch) | |
tree | dc5d9461798a6cb73b487e870bdff0ba981ac641 /o3d | |
parent | 2bf13e39154c79f9072623d76f8875d998b5d8f9 (diff) | |
download | chromium_src-b09288b78170b9b9d9691e7ae208a376547ea5d7.zip chromium_src-b09288b78170b9b9d9691e7ae208a376547ea5d7.tar.gz chromium_src-b09288b78170b9b9d9691e7ae208a376547ea5d7.tar.bz2 |
Changed how checkers sample identifies whether a hit occurred using
clientId rather than object equality. In both Safari and Chrome, if
the browser's JavaScript engine is used rather than O3D's embedded V8,
these equality comparisons fail. It looks like we may need to disable
the use of the embedded V8 for this sample due to bad interactions
with event dispatching.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2334001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/samples/checkers.html | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/o3d/samples/checkers.html b/o3d/samples/checkers.html index 144ee6d..a43e1b395 100644 --- a/o3d/samples/checkers.html +++ b/o3d/samples/checkers.html @@ -581,11 +581,13 @@ function detectSelection(e) { if (pickInfo) { // get the parent transform of this object. var pickTrans = pickInfo.shapeInfo.parent.transform; + var pickTransClientId = pickTrans.clientId; // check if a board square or a piece. for (var x = 0; x < g_boardSize; x += 1) { for (var y = 0; y < g_boardSize; y += 1) { - if (pickTrans === g_board[x][y].piece) { + if (g_board[x][y].piece && + pickTransClientId == g_board[x][y].piece.clientId) { // do not select another player's piece. if (g_player != g_board[x][y].type) return; @@ -605,7 +607,7 @@ function detectSelection(e) { SelectPiece(x, y); return; - } else if (pickTrans === g_board[x][y].square) { + } else if (pickTransClientId == g_board[x][y].square.clientId) { // selected the landing square if a piece move is pending. if (g_selectedPiece) { // check if a forced jump. |