Changed the trashcan lid to always open towards the workspace.

This commit is contained in:
Beka Westberg
2019-01-28 18:04:37 -08:00
parent 8fc4ea19ed
commit 4f51ea222c

View File

@@ -398,9 +398,11 @@ Blockly.Trashcan.prototype.animateLid_ = function() {
* @private
*/
Blockly.Trashcan.prototype.setLidAngle_ = function(lidAngle) {
var openAtRight = this.workspace_.toolboxPosition == Blockly.TOOLBOX_AT_RIGHT
|| (this.workspace_.horizontalLayout && this.workspace_.RTL);
this.svgLid_.setAttribute('transform', 'rotate(' +
(this.workspace_.RTL ? -lidAngle : lidAngle) + ',' +
(this.workspace_.RTL ? 4 : this.WIDTH_ - 4) + ',' +
(openAtRight ? -lidAngle : lidAngle) + ',' +
(openAtRight ? 4 : this.WIDTH_ - 4) + ',' +
(this.LID_HEIGHT_ - 2) + ')');
};