Dynamic-Book / drgeo

GNU Dr. Geo, a Dynamic Knowledge Model on geometry
https://www.gnu.org/s/dr-geo
GNU General Public License v3.0
18 stars 1 forks source link

Locus symmetric does not show up immediately #2

Closed hilaire closed 6 months ago

hilaire commented 9 months ago

In the Fermat Spiral below, when the last line of code is executed, the locus symmetric is not immediately displayed. The user needs to trigger a manual update of the view (by moving one of the object of the view)

| canvas s mobile pen convertFactor locus|
canvas := DrGeoSketch new fullscreen axesOn gridOn.
s := canvas segment: 0@0 to: 10@0.
mobile := canvas pointOnLine:    s at: 0.
convertFactor := 180 / Float halfPi.
pen := canvas 
    point: [ :item | Point r: item point x sqrt degrees: item point x * convertFactor ]
    parent: mobile.
locus := canvas locusOf: pen when: mobile.
canvas symmetry: locus center: 0@0
hilaire commented 6 months ago

It is a tricky bug. Indeed Locus are not sampled from the model but from the view, this is to take in consideration boundaries and the scale factor of the view. Therefore when a transformed locus is asked, the parent locus is not yet sampled and all is executed in a dedicated thread. However the parent locus appears sampled...