Skip to content

Commit

Permalink
Updating #3551 Limits number of digits to 12 in number block (#3610)
Browse files Browse the repository at this point in the history
* changing the limit to 10 written digits

* slight rightward shift of the position of the text written inside the blocks
  • Loading branch information
Albshoji authored Jan 17, 2024
1 parent 59c7928 commit 5490d0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -2442,7 +2442,7 @@ class Block {
// Some special cases
if (SPECIALINPUTS.indexOf(this.name) !== -1) {
this.text.textAlign = "center";
this.text.x = Math.floor((VALUETEXTX * blockScale) / 2 + 0.5);
this.text.x = Math.floor((VALUETEXTX * blockScale) / 2 + 10.0);
if (EXTRAWIDENAMES.indexOf(this.name) !== -1) {
this.text.x *= 3.0;
} else if (WIDENAMES.indexOf(this.name) !== -1) {
Expand Down Expand Up @@ -4073,9 +4073,9 @@ class Block {
this.value = oldValue;
}

if(String(this.value).length > 12) {
if(String(this.value).length > 10) {
const thisBlock = this.blocks.blockList.indexOf(this);
this.activity.errorMsg(_("Numbers can have at most 12 digits."), thisBlock);
this.activity.errorMsg(_("Numbers can have at most 10 digits."), thisBlock);
this.activity.refreshCanvas();
this.label.value = oldValue;
this.value = oldValue;
Expand Down

0 comments on commit 5490d0c

Please sign in to comment.