https://bugs.kde.org/show_bug.cgi?id=342003

--- Comment #5 from jimbo1qaz <jimbo1...@protonmail.com> ---
I'm not a maintainer, but I've done some digging and I think this is the issue.

void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight
)
- defines Okular::Page *page
- okularPage->width() and okularPage->height()
    reflect the "uncropped unzoomed" dimensions of the page (in some units,
IDK).

- finds the unzoomed dimensions
- if cropping enabled, crops them (multiplying by Okular::NormalizedRect[0,1]
coordinates) (cropped unzoomed dimensions)
- multiplies by the zoom factor
- calls PageViewItem::setWHZC(cropped_w, cropped_h) with cropped w,h.

- PageViewItem::setWHZC sets m_croppedGeometry.
- PageViewItem::setWHZC divides by crop boundaries and sets m_uncroppedGeometry

-----------

// compute the zoom factor value for FitWidth and FitPage mode
double PageView::zoomFactorFitMode( ZoomMode mode )
- const double width = okularPage->width(), height = okularPage->height();

This is the bug. width()/height() are uncropped, but FitWidth and FitPage end
up zooming the cropped page region.

We need to use the cropped unzoomed dimensions. But they are not exposed by the
code, instead buried as local variables within PageView::updateItemSize(), and
overwritten by the cropped zoomed versions when calling PageViewItem::setWHZC.

Consequently, currentItem->croppedWidth()/croppedHeight() is not a proper
workaround. How should this bug be fixed?

-----------

Sidenote: Why is Okular written in Qt-flavored C++03 without std::?

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to