-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed Pen demo and "doIt" for inspectors
- Loading branch information
Showing
1 changed file
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
written by Jens Mönig | ||
[email protected] | ||
Copyright (C) 2010-2024 by Jens Mönig | ||
Copyright (C) 2010-2025 by Jens Mönig | ||
This file is part of Snap!. | ||
|
@@ -1338,7 +1338,7 @@ | |
|
||
/*jshint esversion: 11, bitwise: false*/ | ||
|
||
var morphicVersion = '2024-October-09'; | ||
var morphicVersion = '2025-January-21'; | ||
var modules = {}; // keep track of additional loaded modules | ||
var useBlurredShadows = true; | ||
|
||
|
@@ -3122,6 +3122,16 @@ Node.prototype.allChildren = function () { | |
return result; | ||
}; | ||
|
||
Node.prototype.allChildrenExcept = function (callback) { | ||
// includes myself, stops at nodes that satisfy the callback predicate | ||
var result = [this]; | ||
if (callback(this)) {return []; } | ||
this.children.forEach(child => { | ||
result = result.concat(child.allChildrenExcept(callback)); | ||
}); | ||
return result; | ||
}; | ||
|
||
Node.prototype.forAllChildren = function (aFunction) { | ||
if (this.children.length > 0) { | ||
this.children.forEach(child => child.forAllChildren(aFunction)); | ||
|
@@ -3869,6 +3879,7 @@ Morph.prototype.penTrails = function () { | |
// obtained canvas will be around at the next display cycle, | ||
// so they might also wish to set the receiver's "isCachingImage" | ||
// property to "true". | ||
this.isCachingImage = true; | ||
return this.getImage(); | ||
}; | ||
|
||
|
@@ -11502,7 +11513,9 @@ HandMorph.prototype.processMouseDown = function (event) { | |
} | ||
} | ||
if (this.world.cursor) { | ||
if (morph !== this.world.cursor.target) { | ||
if (morph !== this.world.cursor.target && | ||
!morph.parentThatIsA(MenuItemMorph) | ||
) { | ||
this.world.stopEditing(); | ||
} | ||
} | ||
|