Skip to content

Commit

Permalink
tweaked "write" primitive for the stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoenig committed Nov 27, 2023
1 parent b1f7d09 commit 5b17414
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* **Translation Updates:**
* German

2023-11-27
* objects: tweaked "write" primitive for the stage

2023-11-24
* objects: optimized scanning variable memory for function dependencies - speeds up editing custom blocks in projects with large lists
* lists: turned off experimental list indices wrapping by default, not sure whether this is a good idea after all
Expand Down
2 changes: 1 addition & 1 deletion snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script src="src/widgets.js?version=2023-05-24"></script>
<script src="src/blocks.js?version=2023-11-24"></script>
<script src="src/threads.js?version=2023-10-22"></script>
<script src="src/objects.js?version=2023-11-24"></script>
<script src="src/objects.js?version=2023-11-27"></script>
<script src="src/scenes.js?version=2022-10-25"></script>
<script src="src/gui.js?version=2023-11-23"></script>
<script src="src/paint.js?version=2023-05-24"></script>
Expand Down
6 changes: 3 additions & 3 deletions src/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ embedMetadataPNG, SnapExtensions, SnapSerializer, snapEquals*/

/*jshint esversion: 11*/

modules.objects = '2023-November-24';
modules.objects = '2023-November-27';

var SpriteMorph;
var StageMorph;
Expand Down Expand Up @@ -10167,7 +10167,7 @@ StageMorph.prototype.setColorDimension = function (idx, num) {

// StageMorph writing on the trails canvas

StageMorph.prototype.write = function (text, size) { // +++
StageMorph.prototype.write = function (text, size) {
var fontSize = Math.max(3, +size || 1) * this.scale,
textMorph, ctx, img;

Expand Down Expand Up @@ -10205,7 +10205,7 @@ StageMorph.prototype.write = function (text, size) { // +++
ctx.drawImage(
img,
fontSize / 2,
Math.min(0, (this.height() - img.height))
Math.min(0, (this.height() - img.height - fontSize / 2))
);
ctx.restore();
this.changed();
Expand Down

0 comments on commit 5b17414

Please sign in to comment.