OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 base.require('ui'); | 7 base.require('ui'); |
8 base.require('quad_view_viewport'); | 8 base.require('quad_view_viewport'); |
9 base.requireStylesheet('quad_view'); | 9 base.requireStylesheet('quad_view'); |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 createSelection_: function(quadIndices) { | 200 createSelection_: function(quadIndices) { |
201 return new QuadViewSelection(this, quadIndices); | 201 return new QuadViewSelection(this, quadIndices); |
202 }, | 202 }, |
203 selectQuadsAtCanvasClientPoint: function(clientX, clientY) { | 203 selectQuadsAtCanvasClientPoint: function(clientX, clientY) { |
204 var selection = this.createSelection_( | 204 var selection = this.createSelection_( |
205 this.findQuadsAtCanvasClientPoint(clientX, clientY)); | 205 this.findQuadsAtCanvasClientPoint(clientX, clientY)); |
206 var e = new base.Event('selection-changed'); | 206 var e = new base.Event('selection-changed'); |
207 e.selection = selection; | 207 e.selection = selection; |
208 this.dispatchEvent(e); | 208 this.dispatchEvent(e); |
| 209 this.viewport_.forceRedrawAll(); |
209 }, | 210 }, |
210 | 211 |
211 findQuadsAtCanvasClientPoint: function(clientX, clientY) { | 212 findQuadsAtCanvasClientPoint: function(clientX, clientY) { |
212 var bounds = this.canvas_.getBoundingClientRect(); | 213 var bounds = this.canvas_.getBoundingClientRect(); |
213 var vecInLayout = vec2.createXY(clientX - bounds.left, | 214 var vecInLayout = vec2.createXY(clientX - bounds.left, |
214 clientY - bounds.top); | 215 clientY - bounds.top); |
215 var vecInWorldPixels = | 216 var vecInWorldPixels = |
216 this.viewport_.layoutPixelsToWorldPixels2(vecInLayout); | 217 this.viewport_.layoutPixelsToWorldPixels2(vecInLayout); |
217 var pointInWorldPixels = vec2.asPoint(vecInWorldPixels); | 218 var pointInWorldPixels = vec2.asPoint(vecInWorldPixels); |
218 | 219 |
(...skipping 29 matching lines...) Expand all Loading... |
248 } | 249 } |
249 | 250 |
250 }; | 251 }; |
251 | 252 |
252 return { | 253 return { |
253 QuadView: QuadView, | 254 QuadView: QuadView, |
254 QuadViewSelection: QuadViewSelection, | 255 QuadViewSelection: QuadViewSelection, |
255 } | 256 } |
256 }); | 257 }); |
257 | 258 |
OLD | NEW |