Bug 161085 - Zoom steps in image editor
Summary: Zoom steps in image editor
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: ImageEditor-Canvas (show other bugs)
Version: 0.9.4
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-20 21:49 UTC by Mikolaj Machowski
Modified: 2017-08-07 08:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.4
Sentry Crash Report:


Attachments
snap to 50%, 100% and fit as zoom values for the image editor (2.68 KB, patch)
2008-04-25 18:48 UTC, Arnd Baecker
Details
snap to 50%, 100% and fit as zoom values for the image editor (3.22 KB, patch)
2008-04-30 20:23 UTC, Arnd Baecker
Details
snap to 50%, 100% and fit as zoom values for the image editor, revised (3.21 KB, patch)
2008-05-16 21:10 UTC, Arnd Baecker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikolaj Machowski 2008-04-20 21:49:14 UTC
Version:           0.9.4-svn (using Devel)
Installed from:    Compiled sources
Compiler:          gcc4.3 
OS:                Linux

Arnd lately with patch for Bug 157314 introduced snapping to certain values of zoom (50%, fit to window, 100%) which are commonly used. He did it for Preview, and Lighttable. It would be good (consistency) to introduce it also for Image Editor in all areas:

- Ctrl+Mouse Wheel over image
- Clicking on zoom buttons in toolbar
- Mouse scrolling over zoom factors widget

For all of them 100% step is working but 'fit to window' step is also very important and should be implemented.
Comment 1 Arnd Baecker 2008-04-25 18:48:55 UTC
Created attachment 24501 [details]
snap to 50%, 100% and fit as zoom values for the image editor

This patch does not introduce snapping for the list of zoom-values
because just next to it there is a "fit-to-window" button.
Also this would require a lot of code for the special case of a string like
"fit"
in EditorWindow::slotZoomTextChanged(const QString &txt).

Mikolaj, it would be great if you could give this a thorough test...
Comment 2 Mikolaj Machowski 2008-04-25 21:28:55 UTC
>  --> (http://bugs.kde.org/attachment.cgi?id=24501&action=view)


Doesn't work against latest svn. When tried to apply by hand it ended
with:

ighttableview.cpp: In member function 'void 
Digikam::LightTableView::toggleFitToWindowOr100()':
lighttableview.cpp:241: error: no matching function for call 
to 'Digikam::LightTablePreview::setZoomFactor(double, bool)'
../../../digikam/libs/widgets/common/previewwidget.h:53: note: candidates 
are: void Digikam::PreviewWidget::setZoomFactor(double)
lighttableview.cpp:242: error: no matching function for call 
to 'Digikam::LightTablePreview::setZoomFactor(double, bool)'
../../../digikam/libs/widgets/common/previewwidget.h:53: note: candidates 
are: void Digikam::PreviewWidget::setZoomFactor(double)
make[2]: *** [lighttableview.lo] Error 1
make[2]: Leaving directory 
`/home/mikolaj/kde/head/extragear/graphics/digikam/utilities/lighttable'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 
`/home/mikolaj/kde/head/extragear/graphics/digikam/utilities'
make: *** [all-recursive] Error 1
mikolaj@localhost extragear/graphics/digikam $ svn up
W wersji 801135.
Comment 3 Arnd Baecker 2008-04-25 21:46:12 UTC
Mikolaj, I just tried the patch with current svn and it does compile fine.
The toggleFitToWindowOr100() stuff comes from a different patch.
Did you check that `svn diff` is empty before applying the patch here?
Comment 4 Mikolaj Machowski 2008-04-26 08:50:40 UTC
Thanks, patched.

100% works always.

With 50% is funny twist. When going to it first time it IE never stops
at it, each next time going "up" (toward 100%) it is working and usually
works when going "down" but not always. Sorry, don't see any regularity

With fit to window is problem when zoom factor is very close to 50% or
100% (eg. 49% is required for fit). Couldn't really track when it causes
trouble - and which zooming step causes problems. Maybe it is related to
mentioned 50% issues? Usually you can see it when going "down" to lower
zoom factors.
Comment 5 Arnd Baecker 2008-04-30 20:23:08 UTC
Created attachment 24579 [details]
snap to 50%, 100% and fit as zoom values for the image editor

Hi Mikolaj,

thanks a lot for your careful testing, which exposed a stupid bug.
The new version seems to work fine for me in all cases.

Best Arnd
Comment 6 Mikolaj Machowski 2008-05-01 12:17:52 UTC
Does it depend on any other patches?
Comment 7 Arnd Baecker 2008-05-01 16:28:07 UTC
It should not, why?
Comment 8 Mikolaj Machowski 2008-05-01 19:13:15 UTC
Thanks, patch works.

There is small usability thing:

Let's say we are going from 100% down, there are steps:

100% -> 91% -> 78% -> 66% -> 52% -> 50% -> 42% -> Fit screen

Change between 52% and 50% (one of special cases) is really small. Don't
know if it is possible but I would suggest some "thinking" before
deciding about next step:

66% -> next step is 52%, it is less than 5% from 50%, snap to 50%.
Comment 9 Mikolaj Machowski 2008-05-01 19:14:35 UTC
This "thinking" should applies also to Fit to screen and 100% factors of
course.
Comment 10 Arnd Baecker 2008-05-03 19:19:19 UTC
Mikolaj,

thanks a lot for testing!

About the "thinking": yes, this would be nice. Presumably
the best for this would be to pre-compute the sequence of zoom steps,
in some meaningful way. This might be tricky, and for the moment I would
like to proceed with some other bugs, which I find more nagging ... ;-)
So maybe this "thinking" should go into another BKO?

Gilles, could you please review this patch?

Best, Arnd
Comment 11 Mikolaj Machowski 2008-05-04 17:52:45 UTC
> So maybe this "thinking" should go into another BKO?


Created Bug 161619 with additional notes.
Comment 12 caulier.gilles 2008-05-16 12:58:12 UTC
Patch cannot be applied against svn :

patch -p0 < 161085.patch
patching file utilities/imageeditor/canvas/canvas.cpp
Hunk #2 FAILED at 975.
1 out of 2 hunks FAILED -- saving rejects to file utilities/imageeditor/canvas/canvas.cpp.rej
patching file utilities/imageeditor/canvas/canvas.h
Hunk #1 FAILED at 82.
1 out of 1 hunk FAILED -- saving rejects to file utilities/imageeditor/canvas/canvas.h.rej

Gilles
Comment 13 Arnd Baecker 2008-05-16 21:10:01 UTC
Created attachment 24795 [details]
snap to 50%, 100% and fit as zoom values for the image editor, revised

updated patch to current svn
Comment 14 Arnd Baecker 2008-05-16 21:27:55 UTC
SVN commit 808506 by abaecker:

When changing the zoom in the image editor, snap to 50%, 100% and fit-to-window.

CCBUGS: 161085
TODO:KDE4PORT



 M  +2 -1      NEWS  
 M  +88 -2     utilities/imageeditor/canvas/canvas.cpp  
 M  +3 -0      utilities/imageeditor/canvas/canvas.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=808506
Comment 15 caulier.gilles 2008-05-17 14:12:42 UTC
SVN commit 808717 by cgilles:

backport commit #808506 from KDE3 branch
CCBUGS: 161085


 M  +69 -2     canvas.cpp  
 M  +3 -0      canvas.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=808717
Comment 16 Arnd Baecker 2008-05-27 21:22:39 UTC
Gilles, I think this bug can be closed now. Best, Arnd
Comment 17 caulier.gilles 2008-05-27 21:39:22 UTC
*** Bug has been marked as fixed ***.