[BUG]Make Graph Paper fails

Sean Charles bibbers at onetel.net.uk
Tue May 13 09:06:13 UTC 2003


On Monday, May 12, 2003, at 09:50 PM, Ned Konz wrote:
>
> 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".
Nope. I checked mine and I only get a F.I.T.B.Morph that says "Enter grid 
size", that's why I went for the big numbers. I actually was using the 
grid to line things up on the screen.

Hang on a minute....I think we are talking at crossed purposes! I just 
re-read my bug report...I wasn't using the 'set grid spacing option' I 
used 'make graph paper'. I still don't get any message about 1 and 36.

I think you have rumbled something though...!

>
> 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.
>
Couldn't we remove it all together? I mean why limit somebody to a grid 
size? They might actually want to set it to something much bigger, like I 
did. Knowing Squeak well I know that it is a lot better than it would 
appear when it goes bang because I want a big grid!

I think something like a new class called InfiniteGridForm which would 
only need one or all of:

displayOn: aDisplayMedium at: aDisplayPoint clippingBox: clipRectangle 
rule: ruleInteger fillColor: aForm
OR
displayOnPort: aPort at: offset
OR
displayOnPort: aPort offsetBy: offset

to be implemented to do the job. The form extent is the grid size, we know 
the colors and at render time we could just fill the destination and use a 
couple of loops to draw the grid...would save some memory I'm sure.

Somebody more familiar with the innards care to comment? The comment in 
displayOnPort:at says...

	"this *may* not get called at the moment. I have been trying
	to figure out the right way for this to work and am using
	#displayOnPort:offsetBy: as my current offering - Bob"

So I'd me shooting in the dark, i could do all three...may it's 
re-factoring time here?
Just thinking aloud here...if I get some time I'll have a go at 
InfiniteGridForm or something.

> 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.
>
Me, I ain't gonna say nuttin'...like my old Art teacher used to say: "Even 
a fish wouldn't get into trouble if it kept it's big mouth shut!"

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



More information about the Squeak-dev mailing list