Summary: | Zoom farther than 1600% | ||
---|---|---|---|
Product: | [Applications] okular | Reporter: | Dennis Schridde <dennis.schridde> |
Component: | PDF backend | Assignee: | Okular developers <okular-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nate, oliver.sander, yurchor |
Priority: | NOR | ||
Version: | 1.9.3 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/kde/okular/commit/7eb37c99c9cd27bfd918dffe2dca7b9ec22ab5fb | Version Fixed In: | 1.11.0 |
Sentry Crash Report: |
Description
Dennis Schridde
2020-05-13 14:43:47 UTC
pageview.cpp:4203 hardwires the limit: const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; I haven't tried whether anything bad happens (besides possibly large memory/CPU consumption) if that limit is increased further. (In reply to Oliver Sander from comment #1) > pageview.cpp:4203 hardwires the limit: > > const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; > > I haven't tried whether anything bad happens (besides possibly large > memory/CPU consumption) if that limit is increased further. Works fine on a relatively slow machine (Core2 Duo, 2.6GHz, 6GB of RAM) for 100x with the following patch. It is hard to say if it is worth implementing this for a regular user though. diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 938aa5039..f184886e9 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -104,7 +104,7 @@ static const int pageflags = PagePainter::Accessibility | PagePainter::EnhanceLi PagePainter::EnhanceImages | PagePainter::Highlights | PagePainter::TextSelection | PagePainter::Annotations; -static const std::array<float, 13> kZoomValues { 0.12, 0.25, 0.33, 0.50, 0.66, 0.75, 1.00, 1.25, 1.50, 2.00, 4.00, 8.00, 16.00 }; +static const std::array<float, 14> kZoomValues { 0.12, 0.25, 0.33, 0.50, 0.66, 0.75, 1.00, 1.25, 1.50, 2.00, 4.00, 8.00, 16.00, 100.00 }; // This is the length of the text that will be shown when the user is searching for a specific piece of text. static const int searchTextPreviewLength = 21; @@ -2774,7 +2774,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) double nX = (double)(selRect.left() + selRect.right()) / (2.0 * (double)contentAreaWidth()); double nY = (double)(selRect.top() + selRect.bottom()) / (2.0 * (double)contentAreaHeight()); - const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; + const float upperZoomLimit = d->document->supportsTiles() ? 100.0 : 4.0; if ( d->zoomFactor <= upperZoomLimit || zoom <= 1.0 ) { d->zoomFactor *= zoom; @@ -4200,7 +4200,7 @@ void PageView::updateZoom( ZoomMode newZoomMode ) d->zoomFactor = -1; break; } - const float upperZoomLimit = d->document->supportsTiles() ? 16.0 : 4.0; + const float upperZoomLimit = d->document->supportsTiles() ? 100.0 : 4.0; if ( newFactor > upperZoomLimit ) newFactor = upperZoomLimit; if ( newFactor < 0.1 ) @@ -4253,7 +4253,7 @@ void PageView::updateZoomText() bool inserted = false; //use: "d->zoomMode != ZoomFixed" to hide Fit/* zoom ratio int zoomValueCount = 11; if ( d->document->supportsTiles() ) - zoomValueCount = 13; + zoomValueCount = 14; while ( idx < zoomValueCount || !inserted ) { float value = idx < zoomValueCount ? kZoomValues[ idx ] : newFactor; Thanks for testing!
> It is hard to say if it is worth implementing this for a regular user though.
I'd say "definitely": People do request it, and people who don't need it are not bothered by it. Would you mind opening a merge request?
- zoomValueCount = 13;
+ zoomValueCount = 14;
If 100 is the new highest zoom level, then 14 is probably not enough.
(In reply to Oliver Sander from comment #3) > I'd say "definitely": People do request it, and people who don't need it are > not bothered by it. Would you mind opening a merge request? https://invent.kde.org/kde/okular/-/merge_requests/165 Git commit 7eb37c99c9cd27bfd918dffe2dca7b9ec22ab5fb by Oliver Sander, on behalf of Yuri Chornoivan. Committed on 15/05/2020 at 17:44. Pushed by sander into branch 'master'. Add more scale factors M +5 -5 ui/pageview.cpp https://invent.kde.org/kde/okular/commit/7eb37c99c9cd27bfd918dffe2dca7b9ec22ab5fb Zooming farther than 2000% using middle-click-drag zoom is laggy on my Thinkpad X240 (Core i5 4300, 8GB). Additionaly the console reports: Running out of memory on page 2 (26436x25245 px); Apparently tiling does not work correctly there, such a big pixmap would indeed not fit in the memory. |