| Summary: | Viewer / editor: the center of the photo is moving when zooming in or out | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Kevin Goeser <kevin> |
| Component: | ImageEditor-Canvas | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 0.9.0 | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 0.9.2 | |
| Sentry Crash Report: | |||
|
Description
Kevin Goeser
2007-01-08 22:04:37 UTC
I can confirm this bug. It happens with 0.9.0 Kubuntu packages as well as with trunk compiled from SVN (r624276). (Is there any way that I can mark this bug as confirmed?) SVN commit 644214 by cgilles:
digikam from trunk : do not move editor viewport content when zoom in/out.
BUG: 139790
M +16 -6 canvas.cpp
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.cpp #644213:644214
@@ -391,8 +391,8 @@
emit signalSelected(false);
}
- int wZ = int(d->im->width());
- int hZ = int(d->im->height());
+ int wZ = d->im->width();
+ int hZ = d->im->height();
if (visibleWidth() > wZ || visibleHeight() > hZ)
{
@@ -835,11 +835,16 @@
if (d->autoZoom || maxZoom())
return;
+ float cpx = (contentsX() + visibleWidth() / 2.0) / d->zoom;
+ float cpy = (contentsY() + visibleHeight() / 2.0) / d->zoom;
+
d->zoom = d->zoom + 1.0/16.0;
-
d->im->zoom(d->zoom);
-
updateContentsSize();
+
+ viewport()->setUpdatesEnabled(false);
+ center((int)(cpx * d->zoom), (int)(cpy * d->zoom));
+ viewport()->setUpdatesEnabled(true);
viewport()->update();
emit signalZoomChanged(d->zoom);
@@ -850,11 +855,16 @@
if (d->autoZoom || minZoom())
return;
+ float cpx = (contentsX() + visibleWidth() / 2.0) / d->zoom;
+ float cpy = (contentsY() + visibleHeight() / 2.0) / d->zoom;
+
d->zoom = d->zoom - 1.0/16.0;
-
d->im->zoom(d->zoom);
+ updateContentsSize();
- updateContentsSize();
+ viewport()->setUpdatesEnabled(false);
+ center((int)(cpx * d->zoom), (int)(cpy * d->zoom));
+ viewport()->setUpdatesEnabled(true);
viewport()->update();
emit signalZoomChanged(d->zoom);
I believe this problem has been reintroduced with commit 649987. It's fixed since commit #659987 : http://websvn.kde.org/trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.cpp?revision=650567&view=markup Gilles |