Commit Graph

12 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
1a4b3201e7 Update README and do a small code cleanup 2014-07-08 21:23:58 +02:00
Jean-Marc Lasgouttes
f686375eec Change getColumnNearX to getPosNearX
The semantics was bad: the old implementation would return pos - row.pos(), and then all user of the function had to re-add row.pos().
2014-07-08 21:10:47 +02:00
Jean-Marc Lasgouttes
8649ac7fe6 Some fixes related to RTL text
* fix handling of boundary situations in Row::Elements::x2pos;

 * fix handling of boundary situations in TextMetrics::getColumnNearX;

 * make sure to always use Font::isVisibleRightToLeft instead of Font::isRightToLeft;

 * Improve debug messages.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
059de2d04c Fix getColumnNearX for nested insets
The horizontal position of the inset was not taken in account.
The rounding is not always the same as with the old code, but this
is not really important.

Additional changes:

 * improve debug output of rows

 * remove Bidi& argument of the RowPainter constructor, since it is always
   an empty Bifi that is passed. This means that the Bidi class is not
   used at all any more in TextMetrics.cpp. The only remaining user is
   RowPainter.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
6258cebb77 Fix line breaking algorithm
Break words longer than the screen width. The code is more complicated
than I would like, but I have no better idea right now.

Implement properly the notion of a row broken by a display inset. This is useful in different places.

Also fix a bug with last line of a paragraph spotted by Kornel.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
ff608f46fd Handle boundary in getColumnNearX (and more)
Use proper font everywhere for end-of-par marker

Fix getColumnNearX for RTL text and for centered/right-justified paragraphs.

Let computeRowMetrics update the row width.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
f215bb3b92 Re-implement getColumNearX using row elements
The code is now so much shorter that it is scary... Expect that
further changes will be necessary

Cursor boundary is not handled yet.
2014-06-25 17:55:30 +02:00
Jean-Marc Lasgouttes
35d47698c6 Convert cursorX() and computeRowMetrics() to the new scheme
* convert cursorX to new scheme; old computation is still there for the sake of comparison.

* use Row to compute separator width in computeRowMetrics; again, the old code is retained for now.

* Get rid of rowWidth()
2014-06-25 17:54:27 +02:00
Jean-Marc Lasgouttes
b2eba66083 Implement proper handling of RtL in Rows
Now the row elements are sorted according to RtL/LtR.

Some additional cleanup.
2014-06-25 17:54:26 +02:00
Jean-Marc Lasgouttes
452fb60359 Store in the Row object the list of elements it contains
* Row now contains a vector of Elements
* replace Row::dump by a proper << operator
* the width is updated as elements are added
* breakRow is reimplmented to use this infrastructure
2014-06-25 17:54:26 +02:00
Jean-Marc Lasgouttes
8539f756ed Implement real string width computation
Important features:
* widths are cached in a map
* old behavior is still used when lyxrc.force_paint_single_char is true.
2014-06-25 17:54:15 +02:00
Jean-Marc Lasgouttes
b044696d59 Add a readme file describing the state of the branch 2014-06-25 17:53:35 +02:00