fix: correct image unfocusing logic in focusNextImage

This commit is contained in:
2026-01-14 23:59:37 +01:00
parent 1f4d5dcc1d
commit ed469b74f9
+2 -2
View File
@@ -1,7 +1,7 @@
/* /*
* @Author: Uyanide pywang0608@foxmail.com * @Author: Uyanide pywang0608@foxmail.com
* @Date: 2025-08-05 01:22:53 * @Date: 2025-08-05 01:22:53
* @LastEditTime: 2026-01-14 23:50:49 * @LastEditTime: 2026-01-14 23:58:52
* @Description: Animated carousel widget for displaying and selecting images. * @Description: Animated carousel widget for displaying and selecting images.
*/ */
#include "images_carousel.h" #include "images_carousel.h"
@@ -291,8 +291,8 @@ void ImagesCarousel::focusNextImage() {
focusCurrImage(); focusCurrImage();
return; return;
} }
unfocusCurrImage();
if (count <= 1) return; if (count <= 1) return;
unfocusCurrImage();
m_currentIndex++; m_currentIndex++;
if (m_currentIndex >= count) { if (m_currentIndex >= count) {
m_currentIndex = 0; m_currentIndex = 0;