- Element(Type const t, pos_type p, Font const & f, Change const & ch)
- : type(t), pos(p), endpos(p + 1), inset(0), final(false),
- font(f), change(ch) {}
+ // Return total width of element, including separator overhead
+ double width() const { return dim.wid + extra; };
+ /** Return position in pixels (from the left) of position
+ * \param i in the row element.
+ */
+ double pos2x(pos_type const i) const;
+ /** Return character position that is the closest to
+ * pixel position \param x. The value \param x is
+ * adjusted to the actual pixel position.
+ */
+ pos_type x2pos(double &x) const;
+ /** Break the element if possible, so that its width is
+ * less then \param w. Returns true on success.
+ */
+ bool breakAt(double w);