Skip to content

Commit 426d377

Browse files
committed
fix: [slide-show] The Next button should clicked double.
-- The Next button should clicked double. -- The last animation not stop and logic return. Log: fix issue Bug: https://pms.uniontech.com/bug-view-328371.html
1 parent e92de82 commit 426d377

2 files changed

Lines changed: 26 additions & 15 deletions

File tree

libimageviewer/slideshow/imageanimation.cpp

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class LibImageAnimationPrivate : public QWidget
117117
void startSingleNextAnimation();
118118
void startSinglePreAnimation();
119119
void startStatic();
120+
void forceStopCurrentAnimation();
120121
void endSlide()
121122
{
122123
if (m_staticTimer) {
@@ -534,24 +535,20 @@ void LibImageAnimationPrivate::startAnimation()
534535

535536
void LibImageAnimationPrivate::startSingleNextAnimation()
536537
{
537-
if (m_isAnimationIng) {
538-
m_isAnimationIng = false;
539-
} else {
540-
setImage1(m_imageName2);
541-
setImage2(queue->jumpTonext());
542-
startAnimation();
543-
}
538+
if (m_isAnimationIng)
539+
forceStopCurrentAnimation();
540+
setImage1(m_imageName2);
541+
setImage2(queue->jumpTonext());
542+
startAnimation();
544543
}
545544

546545
void LibImageAnimationPrivate::startSinglePreAnimation()
547546
{
548-
if (m_isAnimationIng) {
549-
m_isAnimationIng = false;
550-
} else {
551-
setImage1(m_imageName2);
552-
setImage2(queue->jumpTopre());
553-
startAnimation();
554-
}
547+
if (m_isAnimationIng)
548+
forceStopCurrentAnimation();
549+
setImage1(m_imageName2);
550+
setImage2(queue->jumpTopre());
551+
startAnimation();
555552
}
556553

557554
void LibImageAnimationPrivate::startStatic()
@@ -565,6 +562,20 @@ void LibImageAnimationPrivate::startStatic()
565562
m_staticTimer->start(SLIDER_TIME);
566563
}
567564

565+
void LibImageAnimationPrivate::forceStopCurrentAnimation()
566+
{
567+
if (m_continuousanimationTimer) {
568+
m_continuousanimationTimer->stop();
569+
m_continuousanimationTimer->setInterval(0);
570+
m_factor = 0.0f;
571+
m_isAnimationIng = false;
572+
}
573+
if (m_staticTimer) {
574+
m_staticTimer->stop();
575+
m_staticTimer->setInterval(0);
576+
}
577+
}
578+
568579
void LibImageAnimationPrivate::onContinuousAnimationTimer()
569580
{
570581
Q_Q(LibImageAnimation);

libimageviewer/unionimage/unionimage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "unionimage/imageutils.h"
2626
extern "C" {
27-
#include "3rdparty/tiff-tools/converttiff.h"
27+
#include "../../3rdparty/tiff-tools/converttiff.h"
2828
}
2929

3030
#include <cstring>

0 commit comments

Comments
 (0)