[BUG][FIX] PasteUpMorph color not always a color

Andrew P. Black black at cse.ogi.edu
Thu May 23 07:07:59 UTC 2002


In HandMorph>>generateDropFilesEvent: it is written

	dragType = 1 ifTrue:[
		"experimental drag enter"
		owner borderWidth: 4; borderColor: owner color negated.

owner is this case a PasteUpMorph (the world), which has a picture as 
its Background.  owner color is not in fact a color, but an 
InfiniteForm.  InfiniteForms don't understand #negated.

I'm not sure what the correct fix is here.  Should Morph color always 
answer a color?  In which case, what should be done when the color is 
a pattern or a picture?  Use dominantColor?

Alternatively, if Morph color is legitimately allowed to be a Form, 
then negated should be something else.  I suspect that a 
"contrasting" color is what is wanted here -- but there does not seem 
to be a method that achieves this.  If color is a mid grey, the color 
negated is not a contrasting color.

The quick fix is to say "owner color dominantColor negated", which 
will at last avoid the walkback, since dominantColor on a color just 
returns self.

	Andrew



More information about the Squeak-dev mailing list