mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
cache delete areas instead of recalculating them onMouseDown
This commit is contained in:
@@ -265,6 +265,10 @@ Blockly.Trashcan.prototype.position = function() {
|
||||
* @return {goog.math.Rect} Rectangle in which to delete.
|
||||
*/
|
||||
Blockly.Trashcan.prototype.getClientRect = function() {
|
||||
if (!this.svgGroup_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var trashRect = this.svgGroup_.getBoundingClientRect();
|
||||
var left = trashRect.left + this.SPRITE_LEFT_ - this.MARGIN_HOTSPOT_;
|
||||
var top = trashRect.top + this.SPRITE_TOP_ - this.MARGIN_HOTSPOT_;
|
||||
|
||||
Reference in New Issue
Block a user