diff --git a/.travis.yml b/.travis.yml index 515abf734..2b1a1a773 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ dist: trusty -sudo: true +sudo: true # language: c # diff --git a/Marlin/ubl.h b/Marlin/ubl.h index 90de810a6..b1d3bed78 100644 --- a/Marlin/ubl.h +++ b/Marlin/ubl.h @@ -384,18 +384,12 @@ FORCE_INLINE static float fade_scaling_factor_for_z(const float &lz) { return 1.0; } #endif - FORCE_INLINE static float mesh_index_to_xpos(const uint8_t i) { - if (i= GRID_MAX_POINTS_X-1) { - z1 = 0.0; - z2 = 0.0; - } + if (cell_dest_xi >= GRID_MAX_POINTS_X - 1) z1 = z2 = 0.0; // we are done with the fractional X distance into the cell. Now with the two Z-Heights we have calculated, we // are going to apply the Y-Distance into the cell to interpolate the final Z correction. const float yratio = (RAW_Y_POSITION(end[Y_AXIS]) - mesh_index_to_ypos(cell_dest_yi)) * (1.0 / (MESH_Y_DIST)); - - float z0 = z1 + (z2 - z1) * yratio; - - if ( cell_dest_yi >= GRID_MAX_POINTS_Y-1) - z0 = 0.0; - - z0 *= fade_scaling_factor_for_z(end[Z_AXIS]); + float z0 = cell_dest_yi < GRID_MAX_POINTS_Y - 1 ? z1 + (z2 - z1) * yratio * fade_scaling_factor_for_z(end[Z_AXIS]) : 0.0; /** * If part of the Mesh is undefined, it will show up as NAN