Skip to content

Commit

Permalink
Fix negative pen sizes
Browse files Browse the repository at this point in the history
But still allow pen sizes <1, unlike Scratch
  • Loading branch information
nathan committed Oct 24, 2015
1 parent 68ff86f commit b3ba0df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions phosphorus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2813,11 +2813,13 @@ P.compile = (function() {

} else if (block[0] === 'penSize:') {

source += 'S.penSize = ' + num(block[1]) + ';\n';
source += 'var f = ' + num(block[1]) + ';\n';
source += 'S.penSize = f < 0 ? 0 : f;\n';

} else if (block[0] === 'changePenSizeBy:') {

source += 'S.penSize += ' + num(block[1]) + ';\n';
source += 'var f = S.penSize + ' + num(block[1]) + ';\n';
source += 'S.penSize = f < 0 ? 0 : f;\n';

} else if (block[0] === 'stampCostume') {

Expand Down

0 comments on commit b3ba0df

Please sign in to comment.