mirror of
https://github.com/google/blockly.git
synced 2026-01-17 22:07:10 +01:00
More cleanup.
This commit is contained in:
@@ -172,21 +172,19 @@ Blockly.geras.Highlighter.prototype.drawRightSideRow = function(row) {
|
||||
};
|
||||
|
||||
Blockly.geras.Highlighter.prototype.drawBottomRow = function(row) {
|
||||
var baseline = row.baseline;
|
||||
|
||||
// Highlight the vertical edge of the bottom row on the input side.
|
||||
// Highlighting is always from the top left, both in LTR and RTL.
|
||||
if (this.RTL_) {
|
||||
this.steps_.push('V', baseline - this.highlightOffset_);
|
||||
this.steps_.push('V', row.baseline - this.highlightOffset_);
|
||||
} else {
|
||||
var cornerElem = this.info_.bottomRow.elements[0];
|
||||
if (Blockly.blockRendering.Types.isLeftSquareCorner(cornerElem)) {
|
||||
this.steps_.push(
|
||||
Blockly.utils.svgPaths.moveTo(
|
||||
row.xPos + this.highlightOffset_,
|
||||
baseline - this.highlightOffset_));
|
||||
row.baseline - this.highlightOffset_));
|
||||
} else if (Blockly.blockRendering.Types.isLeftRoundedCorner(cornerElem)) {
|
||||
this.steps_.push(Blockly.utils.svgPaths.moveTo(row.xPos, baseline));
|
||||
this.steps_.push(Blockly.utils.svgPaths.moveTo(row.xPos, row.baseline));
|
||||
this.steps_.push(this.outsideCornerPaths_.bottomLeft());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,8 +319,6 @@ Blockly.geras.RenderInfo.prototype.getElemCenterline_ = function(row, elem) {
|
||||
}
|
||||
} else if (Blockly.blockRendering.Types.isInlineInput(elem)) {
|
||||
result += elem.height / 2;
|
||||
} else if (Blockly.blockRendering.Types.isNextConnection(elem)) {
|
||||
result += (row.height - row.descenderHeight + elem.height / 2);
|
||||
} else {
|
||||
result += (row.height / 2);
|
||||
}
|
||||
|
||||
@@ -222,13 +222,17 @@ Blockly.blockRendering.TopRow = function() {
|
||||
|
||||
/**
|
||||
* The starting point for drawing the row, in the y direction.
|
||||
* This allows us to draw hats and simliar shapes that don't start at the
|
||||
* This allows us to draw hats and similar shapes that don't start at the
|
||||
* origin. Must be non-negative (see #2820).
|
||||
* @package
|
||||
* @type {number}
|
||||
*/
|
||||
this.capline = 0;
|
||||
|
||||
/**
|
||||
* How much the row extends up above its capline.
|
||||
* @type {number}
|
||||
*/
|
||||
this.ascenderHeight = 0;
|
||||
|
||||
/**
|
||||
@@ -356,6 +360,11 @@ Blockly.blockRendering.BottomRow = function() {
|
||||
*/
|
||||
this.descenderHeight = 0;
|
||||
|
||||
/**
|
||||
* The Y position of the bottom edge of the block, relative to the origin
|
||||
* of the block rendering.
|
||||
* @type {number}
|
||||
*/
|
||||
this.baseline = 0;
|
||||
};
|
||||
goog.inherits(Blockly.blockRendering.BottomRow, Blockly.blockRendering.Row);
|
||||
|
||||
@@ -316,8 +316,6 @@ Blockly.thrasos.RenderInfo.prototype.getElemCenterline_ = function(row, elem) {
|
||||
var offset = this.constants_.TALL_INPUT_FIELD_OFFSET_Y +
|
||||
elem.height / 2;
|
||||
result += offset;
|
||||
} else if (Blockly.blockRendering.Types.isNextConnection(elem)) {
|
||||
result += (row.height - row.descenderHeight + elem.height / 2);
|
||||
} else {
|
||||
result += (row.height / 2);
|
||||
}
|
||||
|
||||
@@ -301,14 +301,7 @@ Blockly.zelos.RenderInfo.prototype.getElemCenterline_ = function(row,
|
||||
}
|
||||
return row.capline + elem.height / 2;
|
||||
}
|
||||
|
||||
var result = row.yPos;
|
||||
if (Blockly.blockRendering.Types.isNextConnection(elem)) {
|
||||
result += (row.height - row.descenderHeight + elem.height / 2);
|
||||
} else {
|
||||
result += (row.height / 2);
|
||||
}
|
||||
return result;
|
||||
return row.yPos + row.height / 2;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user