فهرست منبع

fix: Hide passthrough images if all effects are invisible (#539)

Louis 5 ماه پیش
والد
کامیت
be773361d0
1فایلهای تغییر یافته به همراه18 افزوده شده و 3 حذف شده
  1. 18 3
      src/WallpaperEngine/Render/Objects/CImage.cpp

+ 18 - 3
src/WallpaperEngine/Render/Objects/CImage.cpp

@@ -253,9 +253,24 @@ void CImage::setup () {
     // TODO: CHECK ORDER OF THINGS, 2419444134'S ID 27 DEPENDS ON 104'S COMPOSITE_A WHEN OUR LAST RENDER IS ON
     // COMPOSITE_B
     // TODO: SUPPORT PASSTHROUGH (IT'S A SHADER)
-    // passthrough images without effects are bad, do not draw them
-    if (this->m_image.model->passthrough && this->m_image.effects.empty ()) {
-	return;
+    if (this->m_image.model->passthrough) {
+		// passthrough images without effects are bad, do not draw them
+		if(this->m_image.effects.empty ()) {
+			return;
+		}
+
+		// Some have attempted to declare effects with visible set to false.
+		bool allEffectsInvisible = true;
+		for (const auto& cur : this->m_image.effects) {
+			if (cur->visible->value->getBool()) {
+				allEffectsInvisible = false;
+				break;
+			}
+		}
+
+		if (allEffectsInvisible) {
+			return;
+		}
     }
 
     // copy pass to the composite layer