Tweaks to Z fade behavior

This commit is contained in:
Scott Lahteine
2019-09-26 01:15:35 -05:00
parent 1f48eaf03a
commit ee7558a622
4 changed files with 25 additions and 28 deletions

View File

@ -2061,7 +2061,7 @@ void MarlinSettings::postprocess() {
}
else {
ubl.reset();
DEBUG_ECHOLNPGM("UBL System reset()");
DEBUG_ECHOLNPGM("UBL reset");
}
}
#endif

View File

@ -411,15 +411,13 @@ class Planner {
*/
static inline float fade_scaling_factor_for_z(const float &rz) {
static float z_fade_factor = 1;
if (z_fade_height) {
if (rz >= z_fade_height) return 0;
if (last_fade_z != rz) {
last_fade_z = rz;
z_fade_factor = 1 - rz * inverse_z_fade_height;
}
return z_fade_factor;
if (!z_fade_height) return 1;
if (rz >= z_fade_height) return 0;
if (last_fade_z != rz) {
last_fade_z = rz;
z_fade_factor = 1 - rz * inverse_z_fade_height;
}
return 1;
return z_fade_factor;
}
FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; }