On Sat, 2004-01-31 at 18:50, bulia byak wrote:
It IS already a vewport history, that is, each list member in desktop->zooms_past stores four numbers that define the visible area _and_ zoom. However new members to this list are added only when you are zooming in or out, not when you are panning canvas at the same zoom. This is logical: you can pan very slowly, and adding a new "undo step" for each one-pixel panning will make this history unusable.
Well, what I had in mind is that viewport undo steps would be separated by editing operations -- so e.g. consecutive pans/zooms with no edits in between them would be coalesced into a single zoom undo step.
However you gave me an idea: I can store past viewport not only before I do zoom, but also after that; later, when a next zoom is started, I will compare the current viewport with the last stored and, if it's the same, not store it. This way I will be adding one viewport record if there was no panning between zooms and two records if there was panning, these records storing the first and last viewports at this zoom. I think it will be a bit more convenient this way.
Hmm, I'll have to experiment with it a bit.
-mental