File tree Expand file tree Collapse file tree 4 files changed +14
-22
lines changed
Expand file tree Collapse file tree 4 files changed +14
-22
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments