Skip to content

Commit

Permalink
release: v10.2.1
Browse files Browse the repository at this point in the history
Merge pull request #7567 from google/rc/v10.2.1
  • Loading branch information
rachel-fenichel authored Oct 2, 2023
2 parents 2308da8 + f380159 commit ead46e7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
26 changes: 9 additions & 17 deletions core/field_colour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,28 +262,20 @@ export class FieldColour extends Field<string> {
*/
protected updateSize_(margin?: number) {
const constants = this.getConstants();
const xOffset =
margin !== undefined
? margin
: !this.isFullBlockField()
? constants!.FIELD_BORDER_RECT_X_PADDING
: 0;
let totalWidth = xOffset * 2;
let contentWidth = 0;
if (!this.isFullBlockField()) {
contentWidth = constants!.FIELD_COLOUR_DEFAULT_WIDTH;
totalWidth += contentWidth;
}

let totalHeight = constants!.FIELD_TEXT_HEIGHT;
if (!this.isFullBlockField()) {
totalHeight = Math.max(totalHeight, constants!.FIELD_BORDER_RECT_HEIGHT);
let totalWidth;
let totalHeight;
if (this.isFullBlockField()) {
const xOffset = margin ?? 0;
totalWidth = xOffset * 2;
totalHeight = constants!.FIELD_TEXT_HEIGHT;
} else {
totalWidth = constants!.FIELD_COLOUR_DEFAULT_WIDTH;
totalHeight = constants!.FIELD_COLOUR_DEFAULT_HEIGHT;
}

this.size_.height = totalHeight;
this.size_.width = totalWidth;

this.positionTextElement_(xOffset, contentWidth);
this.positionBorderRect_();
}

Expand Down
4 changes: 2 additions & 2 deletions core/renderers/zelos/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ export class ConstantProvider extends BaseConstantProvider {

this.FIELD_DROPDOWN_SVG_ARROW_PADDING = this.FIELD_BORDER_RECT_X_PADDING;

this.FIELD_COLOUR_DEFAULT_WIDTH = 2 * this.GRID_UNIT;
this.FIELD_COLOUR_DEFAULT_WIDTH = 6 * this.GRID_UNIT;

this.FIELD_COLOUR_DEFAULT_HEIGHT = 4 * this.GRID_UNIT;
this.FIELD_COLOUR_DEFAULT_HEIGHT = 8 * this.GRID_UNIT;

this.FIELD_CHECKBOX_X_OFFSET = 1 * this.GRID_UNIT;

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockly",
"version": "10.2.0",
"version": "10.2.1",
"description": "Blockly is a library for building visual programming editors.",
"keywords": [
"blockly"
Expand Down

0 comments on commit ead46e7

Please sign in to comment.