[BUG]Make Graph Paper fails

Ned Konz ned at bike-nomad.com
Mon May 12 21:50:42 UTC 2003


On Monday 12 May 2003 03:21 pm, Sean Charles wrote:
> Trying to use a grid size bigger than 79(?) causes the image to
> foobar big time and the emergency evaluator / revert screen is
> presented. This one died on a grid size of 85 if that's any use. No
> time to dig around myself. Sorry.

That's interesting. When I try to set the grid from the menu, it tells 
me "must be a Point with coordinates between 1 and 36".

When I look at why the 36 in setGridSpec, the comment says "because it 
was that way before".

However, 80 at 80 works.

Hmm... this is because of gridFormOrigin:grid:background:line:
calling 
	40 roundTo: <grid x>
because the assumption was that you'd never want anything bigger than 
40 pixels (or 80?) on a side.

interesting:

40 roundTo: 79 => 79
40 roundTo: 80  => 80
40 roundTo: 81 => 0
40 roundTo: 85 => 0

If you redefine Number>>roundTo: to be

roundTo: quantum
	^self < quantum
		ifTrue: [ quantum ]
		ifFalse: [ (self / quantum) rounded * quantum ]

it works.

Though that's probably a questionable fix.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list