From cbe25a3e47751de84a3cee9a2a1f5e246790fde0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 14 Aug 2016 11:45:56 +0300 Subject: [PATCH] Fully unbind Clipping when legacy mode changes Failing to do so may leave ClipPlanes bound to ClipUnits, leading to undesirable behaviour later on. --- source/clipping.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/clipping.cpp b/source/clipping.cpp index 487eeca6..430a7b6f 100644 --- a/source/clipping.cpp +++ b/source/clipping.cpp @@ -57,9 +57,12 @@ void Clipping::bind(bool legacy) const { if(legacy) static Require _req(MSP_legacy_features); + + if(legacy!=bound_with_legacy) + unbind(); const Clipping *old = current(); - if(!set_current(this) && !(legacy && !bound_with_legacy)) + if(!set_current(this)) return; bound_with_legacy = legacy; -- 2.45.2