How can I control the display of the grid?

classic Classic list List threaded Threaded
5 messages Options
HJH
Reply | Threaded
Open this post in threaded view
|

How can I control the display of the grid?

HJH
Hello Hilaire

So far I know about the

     gridOn

command to show the grid of a DrGeoSketch object.

It there some control possible how the grid is displayed. For example I do not like the numbering such as

0
1.5
3
4.5

as the example below shows.

Regards
Hannes

Example grid with odd numbering
Reply | Threaded
Open this post in threaded view
|

Re: How can I control the display of the grid?

Hilaire Fernandes
Administrator
Le 23/10/2018 à 18:49, HJH [via Dr. Geo Forum] a écrit :

> Hello Hilaire
>
> So far I know about the
>
>      gridOn
>
> command to show the grid of a DrGeoSketch object.
>
> It there some control possible how the grid is displayed. For example
> I do not like the numbering such as
>
> 0
> 1.5
> 3
> 4.5
>
> as the example below shows.

Hello,

Only by zooming the sketch you can change the numbering.

So use the #scale: message.

Hilaire

Was this message helpful?
Tell us!
HJH
Reply | Threaded
Open this post in threaded view
|

Re: How can I control the display of the grid?

HJH
This post was updated on .

I understand. I have to play with different values for the #scale: message

     c := DrGeoSketch minimal.
     c scale: 40

And what do I need to do if I only want to display quadrant number 1? This means to shift the origin to the lower left corner of the displayed area.

--Hannes

Source: https://en.wikipedia.org/wiki/File:Cartesian_coordinates_2D.svg

Reply | Threaded
Open this post in threaded view
|

Re: How can I control the display of the grid?

Hilaire Fernandes
Administrator
Le 24/10/2018 à 12:30, HJH [via Dr. Geo Forum] a écrit :
> And what do I need to do if I only want to display quadrant number 1?

You have to play with the #centerTo: message.

(https://www.gnu.org/software/dr-geo/doc/en/Smalltalk-sketch.html#index-Smalltalk-sketch_002c-various-messages)

But it will be more appropriate to have a message to set directly the
rectangle to be visible.

It should be possible to code in DrGeoSketch a method to do the
necessary computation, depending on the view extent. But you may not
have control on the gridding. (step on the x and y axis)

Fell free to fill a bug ticket as a reminder.

Hilaire

Was this message helpful?
Tell us!
HJH
Reply | Threaded
Open this post in threaded view
|

Re: How can I control the display of the grid?

HJH
#centerTo: works fine. Thank you. --Hannes

centerTo: message