[squeak-dev] The Trunk: MorphicExtras-nice.288.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 13 14:42:26 UTC 2021
Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.288.mcz
==================== Summary ====================
Name: MorphicExtras-nice.288
Author: nice
Time: 13 April 2021, 4:42:17.42642 pm
UUID: 433930ea-23a3-bf42-839b-0f6b1251fc9e
Ancestors: MorphicExtras-eem.287
Fixup URLMorph: there is no instance of Symbol, Symbol is an abstract class for a few years now (15 years ?). We must test someObject isSymbol rather than someObject class == Symbol (or ~~ Symbol like here).
While at it, prefer isSymbol to isKindOf: Symbol.
=============== Diff against MorphicExtras-eem.287 ===============
Item was changed:
----- Method: PostscriptCanvas>>drawPolygon:color:borderWidth:borderColor: (in category 'drawing-polygons') -----
drawPolygon: vertices color: aColor borderWidth: bw borderColor: bc
| fillC |
fillC := self shadowColor ifNil:[aColor].
self
preserveStateDuring: [:pc | pc
outlinePolygon: vertices;
setLinewidth: bw;
fill: fillC
+ andStroke: (bc isSymbol
- andStroke: ((bc isKindOf: Symbol)
ifTrue: [Color gray]
ifFalse: [bc])]!
Item was changed:
----- Method: PostscriptCanvas>>stroke: (in category 'private') -----
stroke: strokeColor
strokeColor ifNil: [^self].
+ strokeColor isSymbol
- (strokeColor isKindOf: Symbol)
ifTrue: [^self paint: Color gray operation: #stroke "punt"].
strokeColor isSolidFill
ifTrue: [^self paint: strokeColor asColor operation: #stroke].
self preserveStateDuring:
[:inner |
inner
strokepath;
fill: strokeColor]!
Item was changed:
----- Method: URLMorph>>mouseUp: (in category 'event handling') -----
mouseUp: evt
| pg ow newPage mm bookUrl bk |
"If url of a book, open it to that page, or bring it in and open to that page."
book ifNotNil: [book == false ifFalse: [
(bookUrl := book) isString ifFalse: [
bookUrl := (SqueakPage stemUrl: url), '.bo'].
+ (bk := BookMorph isInWorld: self world withUrl: bookUrl) isSymbol
+ ifFalse: [^ bk goToPageUrl: url].
- (bk := BookMorph isInWorld: self world withUrl: bookUrl) class ~~ Symbol
- ifTrue: [^ bk goToPageUrl: url].
bk == #conflict ifTrue: [
^ self inform: 'This book is already open in some other project'].
(bk := BookMorph new fromURL: bookUrl) ifNil: [^ self].
bk goToPageUrl: url. "turn to the page"
^ HandMorph attach: bk]].
"If inside a SqueakPage, replace it!!"
pg := self enclosingPage.
pg ifNotNil: [
(ow := pg contentsMorph owner) ifNotNil: [
pg contentsMorph delete. "from its owner"
newPage := SqueakPageCache atURL: url.
mm := newPage fetchContents.
mm ifNotNil: [ow addMorph: mm.
page := newPage].
^ self]].
"If I am a project, jump -- not done yet"
"For now, just put new page on the hand"
newPage := SqueakPageCache atURL: url.
mm := newPage fetchInformIfError.
mm ifNotNil: [self primaryHand attachMorph: mm.
page := newPage].
!
More information about the Squeak-dev
mailing list
|