| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var api = {}; | 5 var api = {}; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Enumeration of scene update commands. | 8 * Enumeration of scene update commands. |
| 9 * @enum {number} | 9 * @enum {number} |
| 10 * @const | 10 * @const |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 setParentId(id) { | 195 setParentId(id) { |
| 196 this.properties['parentId'] = id; | 196 this.properties['parentId'] = id; |
| 197 } | 197 } |
| 198 | 198 |
| 199 /** | 199 /** |
| 200 * Specify the width and height (in meters) of an element. | 200 * Specify the width and height (in meters) of an element. |
| 201 * @param {number} x | 201 * @param {number} x |
| 202 * @param {number} y | 202 * @param {number} y |
| 203 */ | 203 */ |
| 204 setSize(x, y) { | 204 setSize(x, y) { |
| 205 this.properties['size'] = {x: x, y: y}; | 205 // this.properties['size'] = {x: x, y: y}; |
| 206 this.properties['sizeX'] = x; |
| 207 this.properties['sizeY'] = y; |
| 206 } | 208 } |
| 207 | 209 |
| 208 /** | 210 /** |
| 209 * Specify optional scaling of the element, and any children. | 211 * Specify optional scaling of the element, and any children. |
| 210 * @param {number} x | 212 * @param {number} x |
| 211 * @param {number} y | 213 * @param {number} y |
| 212 * @param {number} z | 214 * @param {number} z |
| 213 */ | 215 */ |
| 214 setScale(x, y, z) { | 216 setScale(x, y, z) { |
| 215 this.properties['scale'] = {x: x, y: y, z: z}; | 217 this.properties['scaleX'] = x; |
| 218 this.properties['scaleY'] = y; |
| 219 this.properties['scaleZ'] = z; |
| 216 } | 220 } |
| 217 | 221 |
| 218 /** | 222 /** |
| 219 * Specify rotation for the element. The rotation is specified in axis-angle | 223 * Specify rotation for the element. The rotation is specified in axis-angle |
| 220 * representation (rotate around unit vector [x, y, z] by 'a' radians). | 224 * representation (rotate around unit vector [x, y, z] by 'a' radians). |
| 221 * @param {number} x | 225 * @param {number} x |
| 222 * @param {number} y | 226 * @param {number} y |
| 223 * @param {number} z | 227 * @param {number} z |
| 224 * @param {number} a | 228 * @param {number} a |
| 225 */ | 229 */ |
| 226 setRotation(x, y, z, a) { | 230 setRotation(x, y, z, a) { |
| 227 this.properties['rotation'] = {x: x, y: y, z: z, a: a}; | 231 this.properties['rotationX'] = x; |
| 232 this.properties['rotationY'] = y; |
| 233 this.properties['rotationZ'] = z; |
| 234 this.properties['rotationAngle'] = a; |
| 228 } | 235 } |
| 229 | 236 |
| 230 /** | 237 /** |
| 231 * Specify the translation of the element. If anchoring is specified, the | 238 * Specify the translation of the element. If anchoring is specified, the |
| 232 * offset is applied to the anchoring position rather than the origin. | 239 * offset is applied to the anchoring position rather than the origin. |
| 233 * Translation is applied after scaling and rotation. | 240 * Translation is applied after scaling and rotation. |
| 234 * @param {number} x | 241 * @param {number} x |
| 235 * @param {number} y | 242 * @param {number} y |
| 236 * @param {number} z | 243 * @param {number} z |
| 237 */ | 244 */ |
| 238 setTranslation(x, y, z) { | 245 setTranslation(x, y, z) { |
| 239 this.properties['translation'] = {x: x, y: y, z: z}; | 246 this.properties['translationX'] = x; |
| 247 this.properties['translationY'] = y; |
| 248 this.properties['translationZ'] = z; |
| 240 } | 249 } |
| 241 | 250 |
| 242 /** | 251 /** |
| 243 * Anchoring allows a rectangle to be positioned relative to the edge of | 252 * Anchoring allows a rectangle to be positioned relative to the edge of |
| 244 * its parent, without being concerned about the size of the parent. | 253 * its parent, without being concerned about the size of the parent. |
| 245 * Values should be XAnchoring and YAnchoring elements. | 254 * Values should be XAnchoring and YAnchoring elements. |
| 246 * Example: element.setAnchoring(XAnchoring.XNONE, YAnchoring.YBOTTOM); | 255 * Example: element.setAnchoring(XAnchoring.XNONE, YAnchoring.YBOTTOM); |
| 247 * @param {number} x | 256 * @param {number} x |
| 248 * @param {number} y | 257 * @param {number} y |
| 249 */ | 258 */ |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 if ('updateTab' in dict) { | 577 if ('updateTab' in dict) { |
| 569 this.onUpdateTab(dict['updateTabs']); | 578 this.onUpdateTab(dict['updateTabs']); |
| 570 } | 579 } |
| 571 if ('removeTab' in dict) { | 580 if ('removeTab' in dict) { |
| 572 this.onRemoveTab(dict['removeTab']); | 581 this.onRemoveTab(dict['removeTab']); |
| 573 } | 582 } |
| 574 | 583 |
| 575 this.onCommandHandlerFinished() | 584 this.onCommandHandlerFinished() |
| 576 } | 585 } |
| 577 }; | 586 }; |
| OLD | NEW |