X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FMetricsInfo.h;h=3ad59cd4c63bd401223fca7a305c9484c1375055;hb=4732da8dc2ffb44a418b0e776ff607079720736a;hp=ff0b1c698941faeec9e2add2b2f2f3dc408c4f93;hpb=e7fdce0b5a8dd2bd1b7dea548248cb8cc815c338;p=lyx.git diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h index ff0b1c6989..3ad59cd4c6 100644 --- a/src/MetricsInfo.h +++ b/src/MetricsInfo.h @@ -30,6 +30,7 @@ namespace lyx { namespace frontend { class Painter; } class BufferView; +class Length; class MacroContext; @@ -60,7 +61,8 @@ public: // Temporarily change to the style suitable for use in fractions Changer changeFrac(); // Temporarily change to the style suitable for use in arrays - Changer changeArray(); + // or to style suitable for smallmatrix when \c small is true. + Changer changeArray(bool small = false); // Temporarily change the style to (script)script style Changer changeScript(); /// @@ -69,6 +71,13 @@ public: int solidLineOffset() const { return solid_line_offset_; } /// int dottedLineThickness() const { return dotted_line_thickness_; } + /** return the on-screen size of this length + * + * This version of the function uses the current inset width as + * width and the EM value of the current font. + */ + int inPixels(Length const & len) const; + private: int solid_line_thickness_; int solid_line_offset_; @@ -122,10 +131,10 @@ public: MetricsBase base; /// frontend::Painter & pain; - /// Whether the text at this point is right-to-left (for InsetNewline) + /// Whether the text at this point is right-to-left (for insets) bool ltr_pos; /// The change the parent is part of (change tracking) - Change change_; + Change change; /// Whether the parent is selected as a whole bool selected; /// Whether the spell checker is enabled for the parent @@ -134,6 +143,8 @@ public: bool full_repaint; /// Current background color ColorCode background_color; + /// Useful for drawing display math numbering + int leftx, rightx; }; class TextMetricsInfo {};