Andre Poenitz wrote: > On Thu, Feb 05, 2004 at 12:43:23PM +0100, Alfredo Braunstein wrote: >> I've played a bit with coordinates this morning, and tried to bring LyX >> again to a working state (coord-wise). I think it can be a good starting >> point to choose a right coordinate scheme. >> >> currently is: >> >> - LyXFunc::dispatch uses screen coords (ok) >> >> - BufferView::Pimpl::workAreaDispatch receives screen coords and >> translates inmediately to absolute coords, before dispatching to >> insets::dispatch or lyxtext::dispatch. (ok) >> >> - internal methods from LyXText use a mixture of absolute x,y coords, >> LyXText-relative x,y coords, and relative-y but absolute-x. (not so good. >> I'd try to declare private whatever doesn't takes absolute coords. I >> think storing relative info is ok as long as it is private.) > > I'd think we should settle here for a clear scheme, i.e. either absolute > or screen-relative.
screen-relative is out of the question: it's clearly worse than absolute. The only things that can use screen-relative coords are on early stages of the dispatch process (say that workareadispatch could use it for mouse gestures or whatever) and on last steps of the draw process (for obvious reasons). Except that two cases we can take the screen business out and work with doc absolute coords everywhare I think. > >> - inset::dispatch and lyxtext::dispatch take absolute coords (ok) >> >> - the cached x,y position in insets is screen-relative (bad) > > I can't really make up my mind with all this coordinates business. > 'Everything absolute' would be nice, but we can't update the caches all > the time... Why would we need to update them all the time? we update them at draw time exactly as now, and the only ones who have correct info are the ones shown. Again, I think that absolute beats screen-relative in every aspect. (putting absolute coords in the insettext cache should be automatic at this point) For internal things LyXText-relative, or par-relative is fine I think (as long as things remain somewhat private). Alfredo
