Skip to content

Commit

Permalink
Fix shadow dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyMakesThings authored Feb 14, 2024
1 parent 9ecbbce commit dbcef01
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions core/field_angle.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,28 @@ Blockly.FieldAngle.prototype.showEditor_ = function() {
Blockly.mainWorkspace.options.pathToMedia + Blockly.FieldAngle.ARROW_SVG_PATH
);

Blockly.DropDownDiv.setColour(this.sourceBlock_.parentBlock_.getColour(),
this.sourceBlock_.getColourTertiary());
Blockly.DropDownDiv.setCategory(this.sourceBlock_.parentBlock_.getCategory());
Blockly.DropDownDiv.showPositionedByBlock(this, this.sourceBlock_);
if (this.sourceBlock_.isShadow()) {
Blockly.DropDownDiv.setColour(this.sourceBlock_.parentBlock_.getColour(),
this.sourceBlock_.getColourTertiary());
Blockly.DropDownDiv.setCategory(this.sourceBlock_.parentBlock_.getCategory());
Blockly.DropDownDiv.showPositionedByBlock(this, this.sourceBlock_);
} else {
// Calculate positioning based on the field position.
var scale = this.sourceBlock_.workspace.scale;
var bBox = {width: this.size_.width, height: this.size_.height};
bBox.width *= scale;
bBox.height *= scale;
var position = this.fieldGroup_.getBoundingClientRect();
var primaryX = position.left + bBox.width / 2;
var primaryY = position.top + bBox.height;

Check failure on line 262 in core/field_angle.js

View workflow job for this annotation

GitHub Actions / build

'primaryY' is assigned a value but never used. Allowed unused vars must match /^_/
var secondaryX = primaryX;

Check failure on line 263 in core/field_angle.js

View workflow job for this annotation

GitHub Actions / build

'secondaryX' is assigned a value but never used. Allowed unused vars must match /^_/
var secondaryY = position.top;

Check failure on line 264 in core/field_angle.js

View workflow job for this annotation

GitHub Actions / build

'secondaryY' is assigned a value but never used. Allowed unused vars must match /^_/

Blockly.DropDownDiv.setColour(this.sourceBlock_.getColour(),
this.sourceBlock_.getColourTertiary());
Blockly.DropDownDiv.setCategory(this.sourceBlock_.getCategory());
Blockly.DropDownDiv.show(this, this.sourceBlock_);
}

this.mouseDownWrapper_ =
Blockly.bindEvent_(this.handle_, 'mousedown', this, this.onMouseDown);
Expand Down

0 comments on commit dbcef01

Please sign in to comment.