X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2FPAINTING_ANALYSIS;h=c287710ef8c34326212a3b11a507fcf97c3d4bc4;hb=3e7665f2c67a694e928724c3bc058f2f66c30b52;hp=74aaa99a744b469b872e478ed4c7d84b4b167fd7;hpb=598f7e4a45dc10232a42db34e5ca887615c5306f;p=lyx.git diff --git a/development/PAINTING_ANALYSIS b/development/PAINTING_ANALYSIS index 74aaa99a74..c287710ef8 100644 --- a/development/PAINTING_ANALYSIS +++ b/development/PAINTING_ANALYSIS @@ -58,67 +58,22 @@ The global idea would be to extend FitCursor to cover also horizontal cursor. -* Proposals - - * Clean-up of drawing code The goal is to make painting with drawing disable fast enough that it can be used after every metrics computation. Then we can separate real drawing from metrics. -** DONE RowPainter - -Inset position is set in paintInset, paintOnlyInsets, and paintText. -This should be done only once in paintInset - -** DONE TextMetrics::drawParagraph - -We can really simplify the code when drawing is disabled only -paintInset needs to be called. - + do right at the start when drawing is already disabled - + do it in the loop for rows that are not visible on screen. - -The only thing we want to do here is to set inset positions (for -text). The other insets still use the painter with drawing disabled. +Other changes are only clean-ups. -** DONE Painter::text +** When a paragraph ends with a newline, compute correctly the height of the extra row. +** Rewrite TextMetrics::editXY, checkInsetHit using row information (getPosNearX)? -We cannot remove (or make private) the version that uses a -FontInfo because it is used by PainterInfo::draw. Document this and -remove unused arguments rtl and double spacing. This would become a specialized helper. -Proposed solution: keep the existing function, but private and without -optional arguments. + The helper version should return a Row::Element instead of an InsetTable. -Avoid to return (and thus compute) the width of strings? - + used by InsetSpecialChar (fixable) - + used by textDecoration() in text(): more difficult to fix +** Remember rtl status in the row object -Idea: add a version of text where wordspacing and textwidth (giving -the width of strings) are required parameters and remove optional -version. - -==> more versions, no optional parameters. - -** make Inset::display() more useful - -Extending the DisplayType enum would allow to remove special cases -from the code. - -The enumeration could be like -: Inline = 0 -: BreakBefore = 1 // break row before this inset -: BreakAfter = 2 // break row after this inset -: CanBreakAfter = 4 // optionally break row after this inset -: AlignLeft = 8 -: AlignRight = 16 -: NoBoundary = 32 // do not allow cursor to go at the end of the row -: //before display inset -: Display = BreakBefore|BreakAfter - -A display equation would be Display, other could be Display|AlignLeft -BreakAfter can be used by Newline or separator insets -CanBreakAfter can be used by the optional hyphen InsetSpecialChar. +This will avoid to pass a Paragraph object to methods that do not need it. ** Set inset position during metrics phase @@ -204,12 +159,8 @@ update flag is Update::None. ** Metrics computation This is triggered by bv::updateMetrics, which calls tm::redoParagraph for - + all visible paragraphs - + paragraph above the screen (up to one page) - + paragraphs below the screen (up to one page again) - -The paragraphs outside of the screen are required to make PageUp/Down -work. +all visible paragraphs. Paragraphs above or below the screen (needed +for page up/down) and computed as needed. tm::redoParagraph will call Inset::metrics for each inset. In the case of text insets, this will invoke recursively tm::metrics, which redoes