[BUG FIX] Form initFromArray:

john-reed.x.maffeo at mail.sprint.com john-reed.x.maffeo at mail.sprint.com
Fri May 17 01:03:00 UTC 2002


The current version of  Form initFromArray: is broken in several ways.

I have modified the method in several ways to correct the problems that 
I saw.

This version does a better job of tiling in forms with an aspectratios 
between 0.5 and 1.5 i.e. 16 at 32 works ok, 16 at 64 does not.

---snip---
'From Squeak3.0 of 4 February 2001 [latest update: #3545] on 16 May 
2002 at 7:43:31 pm'!

!Form methodsFor: 'private' stamp: 'jrm 5/16/2002 19:21'!
initFromArray: array
	"If the array is filled with SmallIntegers, make them 
LargeIntegers. Fill the bitmap from array.  If the array is shorter,
	then cycle around in its contents until the bitmap is filled."
	| currentIndex arraySize repeatCount |
	(array anySatisfy: [ :each | each > 655535])  
		ifFalse: [^ self initFromArray: (array collect: [:each | 
(each bitShift: 16) bitXor: each])].
	currentIndex _ 0. 
	arraySize _ array size.
	repeatCount _ (bits size / 32) ceiling  sqrt. 
	1 to: bits size  by: repeatCount do:
		 [:index | (currentIndex _ currentIndex + 1) > arraySize 
ifTrue: [currentIndex _ 1].
			index to: index + (repeatCount -1) do:[ :idx |  bits at: 
idx put: (array at: currentIndex)]].! !
---end---

Best Regards,

John-Reed Maffeo 
Sprint Integrated Systems Solutions
Customer Interface Management Systems
Applications Development and Testing 
Chicago Center
312-356-2163 Chicago
312-933-5967 PCS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Pform-initFromArray.st
Type: application/octet-stream
Size: 859 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020516/b5f297bc/Pform-initFromArray.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WINMAIL.DAT
Type: application/ms-tnef
Size: 5571 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020516/b5f297bc/WINMAIL.bin


More information about the Squeak-dev mailing list