Hi Alex,

I've cc'ed calligra-devel, since this problem is deep in the shared kotext code, and I think that only the words development lead, Camillab knows anything about it! I wouldn't be able to guess the correct solution...

On Fri, 30 Jan 2015, Alex Demko wrote:

Although the submitter reported this bug resolved, I think it's still
open, as I'm able to reliably reproduce it in the most recent
calligra/2.9 branch. If I increase Drop Caps->Number It Covers to say
4, and then keep decrementing Indents/Spacing->Line Spaces->Fixes
lower and lower, around 9 or so I can get it to crash. I assume it's
all dependant on the font any ways.

The bug triggers the assert in:

void KoTextLayoutArea::setBottom(qreal bottom)
{
   d->boundingRect.setBottom(bottom + qMax(qreal(0.0),
d->verticalAlignOffset));
   Q_ASSERT_X(d->boundingRect.top() <= d->boundingRect.bottom(),
__FUNCTION__, "Bounding-rect is not normalized");
   d->bottom = bottom;
}

Which is understandable because bottom in my case is -9.57456e-13, aka
-tiny. With top()==0 and bottom()==-tiny, it's not normalized. How did
it become -tiny and not real 0? It seems in this bit of code:

libs/textlayout/KoTextLayoutArea.cpp:1295:

       d->neededWidth = qMax(d->neededWidth, line.naturalTextWidth()
+ d->indent);

       if (!runAroundHelper.stayOnBaseline() &&
!(block.blockFormat().hasProperty(KoParagraphStyle::HiddenByTable)
        && block.length() <= 1)) {
// d-> is -6 and maxLineHeight is 6
           d->y += maxLineHeight;  // <---- the culprit
// d->y is now -tiny
           maxLineHeight = 0;
           d->indent = 0;
           d->extraTextIndent = 0;
           ++numBaselineShifts;
       }


It seems -6 + 6 gives us -tiny, which is understandable as this all in
real numbers and round off errors are expected.

Now, this is inside KoTextLayoutArea::layoutBlock(), which is quite
the monster, so it might be easier for devs familiar with this code to
handle it. Alternatively, I can fix it, but I'd need to know the
approach... Can d->y be reset to its entry value? Can it be reset to
0? etc.

Thanks
_______________________________________________
Krita mailing list
kimages...@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop

_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel

Reply via email to