Stefan Schimanski wrote:
Hi!

While debugging some display oddities of math macros in connection to multiple bufferviews, I came across the atom_dim_ array in MathData. This caches the dimensions of the atoms as the name suggests, and later uses this data also for other things like cursor positioning.

At least if atoms have different sizes in different BufferViews the atoms might "jump around" sometimes. This is caused by invalid atom_dims_ values because the current view does not get new metrics (it's only drawn), but the other views do get them. Hence the current view drawing might depend on atom_dims_ of another view.

Below is a patch to change this by making it dependent on the buffer view.

I'd prefer a solution that externalize the dimensions instead, like all other insets. MathData is the equivalent for Paragraph in the mathed world; I created ParagraphMetrics specifically to separate the contents from the view. So a new MathMetrics class that handles everything Dimension oriented would be better IMO. You could complement the CoordCache to handle this; or maintain a map in BufferView (like the text_metrics_ one). Memory wise, this would be better than your patch, but I also understand that your patch is simpler and I don't plan to do any work on that. So you decide ;-)


Any comments?

Looks good otherwise.

Abdel.

Reply via email to