esternin / eXtrema

https://www.physics.brocku.ca/Labs/extrema/
GNU General Public License v2.0
6 stars 1 forks source link

`replot` does not clear canvas #53

Closed esternin closed 2 years ago

esternin commented 3 years ago

replot is a command that is typically used to rescale the axes, so that all the data fits (the axes are scaled by the first graph command, and all subsequent graph\overlay do not rescale the axes, so some data may not fit inside the plot scaled by the first graph command.

Because of that, replot needs to blank the canvas before replotting. Right now, it re-plots the new, rescaled graph, right on top of the one that is already there, doubling axes etc. Here's a small sample:

image

esternin commented 3 years ago

The workaround is to execute clear\-replot every time before replot

esternin commented 2 years ago

@vadz: I was hoping it was a wxWidgets bug, but the problem persists under wx v.3.2.1.

vadz commented 2 years ago

Sorry, I don't think there is any specifically wx-related bug here, why do you think so?

esternin commented 2 years ago

Because I was locked into thinking about it as the (sub)window not being painted white, while in fact its was the same stupid typo in the (sub)window coordinate box that showed itself as "erasing the wrong (sub)window".

Fixed by 3b9c58a.

esternin commented 2 years ago

P.S. With that fixed, [Edit: most, though not all] gdk errors stopped showing up! They seemed benign, and I could not decipher that it was writing white background rectangle beyond canvas that was doing it, the error messages were, e.g.:

(extrema:1253): Gtk-CRITICAL **: 21:13:15.458: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

And now they are gone!