fix: noise texture in primitive emits changed

This commit is contained in:
Sara Gerretsen 2025-11-18 22:55:29 +01:00
parent 61ba2a54f2
commit 841571cf04

View file

@ -124,7 +124,13 @@ void NoisePrimitive::evaluate(Vector2 at, float &io_height) const {
} }
void NoisePrimitive::set_noise(Ref<Noise> noise) { void NoisePrimitive::set_noise(Ref<Noise> noise) {
if (this->noise.is_valid()) {
this->noise->disconnect_changed(callable_mp(cast_to<Resource>(this), &Resource::emit_changed));
}
this->noise = noise; this->noise = noise;
if (this->noise.is_valid()) {
this->noise->connect_changed(callable_mp(cast_to<Resource>(this), &Resource::emit_changed));
}
emit_changed(); emit_changed();
} }