Dimension const InsetText::dimension(BufferView const & bv) const { TextMetrics const & tm = bv.textMetrics(&text_); Dimension dim = tm.dimension(); dim.wid += 2 * TEXT_TO_INSET_OFFSET; dim.des += TEXT_TO_INSET_OFFSET; dim.asc += TEXT_TO_INSET_OFFSET; return dim; }
void InsetText::cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const { x = bv.textMetrics(&text_).cursorX(sl, boundary) + TEXT_TO_INSET_OFFSET; y = bv.textMetrics(&text_).cursorY(sl, boundary); }