mirror of
https://github.com/google/blockly.git
synced 2026-01-13 20:07:08 +01:00
@@ -194,13 +194,13 @@ Blockly.blockRendering.ConstantProvider = function() {
|
||||
|
||||
/**
|
||||
* Height of the top hat.
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.START_HAT_HEIGHT = 15;
|
||||
|
||||
/**
|
||||
* Width of the top hat.
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.START_HAT_WIDTH = 100;
|
||||
|
||||
|
||||
@@ -189,6 +189,16 @@ Blockly.zelos.ConstantProvider = function() {
|
||||
*/
|
||||
this.JAGGED_TEETH_WIDTH = 0;
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
this.START_HAT_HEIGHT = 22;
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
this.START_HAT_WIDTH = 96;
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
* @override
|
||||
@@ -423,6 +433,27 @@ Blockly.zelos.ConstantProvider.prototype.dispose = function() {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
Blockly.zelos.ConstantProvider.prototype.makeStartHat = function() {
|
||||
var height = this.START_HAT_HEIGHT;
|
||||
var width = this.START_HAT_WIDTH;
|
||||
|
||||
var mainPath =
|
||||
Blockly.utils.svgPaths.curve('c',
|
||||
[
|
||||
Blockly.utils.svgPaths.point(25, -height),
|
||||
Blockly.utils.svgPaths.point(71, -height),
|
||||
Blockly.utils.svgPaths.point(width, 0)
|
||||
]);
|
||||
return {
|
||||
height: height,
|
||||
width: width,
|
||||
path: mainPath
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Create sizing and path information about a hexagonal shape.
|
||||
* @return {!Object} An object containing sizing and path information about
|
||||
|
||||
@@ -181,6 +181,11 @@ Blockly.zelos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) {
|
||||
return next.notchOffset - this.constants_.CORNER_RADIUS;
|
||||
}
|
||||
}
|
||||
// Spacing between a square corner and a hat.
|
||||
if (prev && Blockly.blockRendering.Types.isLeftSquareCorner(prev) && next &&
|
||||
Blockly.blockRendering.Types.isHat(next)) {
|
||||
return this.constants_.NO_PADDING;
|
||||
}
|
||||
return this.constants_.MEDIUM_PADDING;
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,10 @@ Blockly.zelos.TopRow.prototype.endsWithElemSpacer = function() {
|
||||
* @override
|
||||
*/
|
||||
Blockly.zelos.TopRow.prototype.hasLeftSquareCorner = function(block) {
|
||||
return !!block.outputConnection;
|
||||
var hasHat = (typeof block.hat !== 'undefined' ?
|
||||
block.hat === 'cap' : this.constants_.ADD_START_HATS) &&
|
||||
!block.outputConnection && !block.previousConnection;
|
||||
return !!block.outputConnection || hasHat;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user