clipping: Fix wrong AO handling

This commit is contained in:
2026-05-19 07:49:40 +02:00
parent 106841f6ef
commit aa9a6f56b6

View File

@@ -56,16 +56,16 @@ export default class extends Controller {
btn.classList.remove('border', 'border-2', 'border-warning'); btn.classList.remove('border', 'border-2', 'border-warning');
}); });
// AO should be turned off if clipping is enabled
toggleAmbientOcclusion(!this.enabledValue);
if (this.enabledValue) { if (this.enabledValue) {
// AO should be turned off if clipping is enabled
toggleAmbientOcclusion(false);
trigger.className += ' border border-2 border-white'; trigger.className += ' border border-2 border-white';
} }
if (!this.enabledValue) { if (!this.enabledValue) {
resetClipping(); resetClipping();
trigger.className = trigger.className.replace(/ border.*$/g, ''); trigger.className = trigger.className.replace(/ border.*$/g, '');
toggleAmbientOcclusion(AppState.ambientOcclusion);
} }
AppState.clipping.enabled = this.enabledValue; AppState.clipping.enabled = this.enabledValue;