• Justin Luth's avatar
    tdf#109190 sd MakeVisible: fix flattened loop logic error · 13328a36
    Justin Luth yazdı
    There is a bug in the conversion from
    while(rRect.Bottom() > aNewPos.Y() + aVisAreaSize.Height())
    to
    const long distBottom(rRect.Bottom() - aNewPos.Y() + aVisAreaSize.Height());
    
    While the bottom of the object is lower on the page than
    the visual Top position plus the height of the screen,
    (in other words, it isn't in the visible range of the screen),
    move the screen down by the size of the object and try again.
    
    The loop could first be finished when the shape bottom is
    exactly at the bottom of the screen:
    rRect.Bottom() = aNewPos.Y() + screen Height.
    or rRect.Bottom() - (aNewPos.Y() + aVisAreaSize.Height()) = 0
    or rRect.Bottom() -  aNewPos.Y() - aVisAreaSize.Height()  = 0
    
    Change-Id: I762a39df3cdcd5689c8f6742797a9f7b38ddb384
    Reviewed-on: https://gerrit.libreoffice.org/55156Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
    Tested-by: 's avatarJustin Luth <justin_luth@sil.org>
    Reviewed-by: 's avatarArmin Le Grand <Armin.Le.Grand@cib.de>
    13328a36
drviewsh.cxx 7.08 KB