mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Set the border size on a text input to take into account scaling. (#2837)
This commit is contained in:
@@ -88,6 +88,11 @@ Blockly.FieldTextInput.prototype.SERIALIZABLE = true;
|
||||
*/
|
||||
Blockly.FieldTextInput.FONTSIZE = 11;
|
||||
|
||||
/**
|
||||
* Pixel size of input border radius. Should match blocklyText's border-radius in CSS.
|
||||
*/
|
||||
Blockly.FieldTextInput.BORDERRADIUS = 4;
|
||||
|
||||
/**
|
||||
* Mouse cursor style when over the hotspot that initiates the editor.
|
||||
*/
|
||||
@@ -252,6 +257,9 @@ Blockly.FieldTextInput.prototype.widgetCreate_ = function() {
|
||||
(Blockly.FieldTextInput.FONTSIZE * this.workspace_.scale) + 'pt';
|
||||
div.style.fontSize = fontSize;
|
||||
htmlInput.style.fontSize = fontSize;
|
||||
var borderRadius =
|
||||
(Blockly.FieldTextInput.BORDERRADIUS * this.workspace_.scale) + 'px';
|
||||
htmlInput.style.borderRadius = borderRadius;
|
||||
div.appendChild(htmlInput);
|
||||
|
||||
htmlInput.value = htmlInput.defaultValue = this.value_;
|
||||
|
||||
Reference in New Issue
Block a user