mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Add dark path offset in geras info.
This commit is contained in:
@@ -92,10 +92,8 @@ Blockly.blockRendering.Drawer.prototype.draw = function() {
|
||||
Blockly.blockRendering.Drawer.prototype.recordSizeOnBlock_ = function() {
|
||||
// This is used when the block is reporting its size to anyone else.
|
||||
// The dark path adds to the size of the block in both X and Y.
|
||||
this.block_.height = this.info_.height +
|
||||
this.constants_.DARK_PATH_OFFSET;
|
||||
this.block_.width = this.info_.widthWithChildren +
|
||||
this.constants_.DARK_PATH_OFFSET;
|
||||
this.block_.height = this.info_.height;
|
||||
this.block_.width = this.info_.widthWithChildren;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,18 +70,6 @@ Blockly.geras.Drawer.prototype.draw = function() {
|
||||
this.recordSizeOnBlock_();
|
||||
};
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
Blockly.geras.Drawer.prototype.recordSizeOnBlock_ = function() {
|
||||
// This is used when the block is reporting its size to anyone else.
|
||||
// The dark path adds to the size of the block in both X and Y.
|
||||
this.block_.height = this.info_.height +
|
||||
this.constants_.DARK_PATH_OFFSET;
|
||||
this.block_.width = this.info_.widthWithChildren +
|
||||
this.constants_.DARK_PATH_OFFSET;
|
||||
};
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
|
||||
@@ -211,7 +211,7 @@ Blockly.geras.Highlighter.prototype.drawLeft = function() {
|
||||
this.steps_ += Blockly.utils.svgPaths.moveTo(this.info_.startX, tabBottom);
|
||||
} else {
|
||||
var left = this.info_.startX + this.highlightOffset_;
|
||||
var bottom = this.info_.height - this.highlightOffset_;
|
||||
var bottom = this.info_.bottomRow.baseline - this.highlightOffset_;
|
||||
this.steps_ += Blockly.utils.svgPaths.moveTo(left, bottom);
|
||||
this.steps_ += Blockly.utils.svgPaths.lineOnAxis('V', tabBottom);
|
||||
}
|
||||
|
||||
@@ -359,8 +359,10 @@ Blockly.geras.RenderInfo.prototype.finalize_ = function() {
|
||||
}
|
||||
this.bottomRow.baseline = yCursor - this.bottomRow.descenderHeight;
|
||||
|
||||
this.widthWithChildren = widestRowWithConnectedBlocks + this.startX;
|
||||
|
||||
this.height = yCursor;
|
||||
// The dark (lowlight) adds to the size of the block in both x and y.
|
||||
this.widthWithChildren = widestRowWithConnectedBlocks +
|
||||
this.startX + this.constants_.DARK_PATH_OFFSET;
|
||||
this.width += this.constants_.DARK_PATH_OFFSET;
|
||||
this.height = yCursor + this.constants_.DARK_PATH_OFFSET;
|
||||
this.startY = this.topRow.capline;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user