Skip to content

Commit ead46e7

Browse files
release: v10.2.1
Merge pull request #7567 from google/rc/v10.2.1
2 parents 2308da8 + f380159 commit ead46e7

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

core/field_colour.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -262,28 +262,20 @@ export class FieldColour extends Field<string> {
262262
*/
263263
protected updateSize_(margin?: number) {
264264
const constants = this.getConstants();
265-
const xOffset =
266-
margin !== undefined
267-
? margin
268-
: !this.isFullBlockField()
269-
? constants!.FIELD_BORDER_RECT_X_PADDING
270-
: 0;
271-
let totalWidth = xOffset * 2;
272-
let contentWidth = 0;
273-
if (!this.isFullBlockField()) {
274-
contentWidth = constants!.FIELD_COLOUR_DEFAULT_WIDTH;
275-
totalWidth += contentWidth;
276-
}
277-
278-
let totalHeight = constants!.FIELD_TEXT_HEIGHT;
279-
if (!this.isFullBlockField()) {
280-
totalHeight = Math.max(totalHeight, constants!.FIELD_BORDER_RECT_HEIGHT);
265+
let totalWidth;
266+
let totalHeight;
267+
if (this.isFullBlockField()) {
268+
const xOffset = margin ?? 0;
269+
totalWidth = xOffset * 2;
270+
totalHeight = constants!.FIELD_TEXT_HEIGHT;
271+
} else {
272+
totalWidth = constants!.FIELD_COLOUR_DEFAULT_WIDTH;
273+
totalHeight = constants!.FIELD_COLOUR_DEFAULT_HEIGHT;
281274
}
282275

283276
this.size_.height = totalHeight;
284277
this.size_.width = totalWidth;
285278

286-
this.positionTextElement_(xOffset, contentWidth);
287279
this.positionBorderRect_();
288280
}
289281

core/renderers/zelos/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ export class ConstantProvider extends BaseConstantProvider {
217217

218218
this.FIELD_DROPDOWN_SVG_ARROW_PADDING = this.FIELD_BORDER_RECT_X_PADDING;
219219

220-
this.FIELD_COLOUR_DEFAULT_WIDTH = 2 * this.GRID_UNIT;
220+
this.FIELD_COLOUR_DEFAULT_WIDTH = 6 * this.GRID_UNIT;
221221

222-
this.FIELD_COLOUR_DEFAULT_HEIGHT = 4 * this.GRID_UNIT;
222+
this.FIELD_COLOUR_DEFAULT_HEIGHT = 8 * this.GRID_UNIT;
223223

224224
this.FIELD_CHECKBOX_X_OFFSET = 1 * this.GRID_UNIT;
225225

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blockly",
3-
"version": "10.2.0",
3+
"version": "10.2.1",
44
"description": "Blockly is a library for building visual programming editors.",
55
"keywords": [
66
"blockly"

0 commit comments

Comments
 (0)