diff --git a/src/DrawComponents/DrawComponent.cpp b/src/DrawComponents/DrawComponent.cpp index 3a15e85..91bbec1 100644 --- a/src/DrawComponents/DrawComponent.cpp +++ b/src/DrawComponents/DrawComponent.cpp @@ -187,7 +187,7 @@ void DrawComponent::canvas_do_calculated_transform(SkCanvas* canvas) { } void DrawComponent::calculate_draw_transform(const DrawData& drawData) { - drawSetupData.shouldDraw = !drawData.clampDrawBetween || ((drawData.clampDrawMaximum >= coords.inverseScale) && (drawData.clampDrawMinimum < coords.inverseScale)); + drawSetupData.shouldDraw = !drawData.clampDrawBetween || (drawData.clampDrawMinimum < coords.inverseScale); if(drawSetupData.shouldDraw) { drawSetupData.shouldDraw = !worldAABB || SCollision::collide(*worldAABB, drawData.cam.viewingAreaGenerousCollider); if(drawSetupData.shouldDraw) { @@ -199,7 +199,7 @@ void DrawComponent::calculate_draw_transform(const DrawData& drawData) { drawSetupData.mipmapLevel = 0; drawSetupData.transformData.translation = -coords.to_space(drawData.cam.c.pos); drawSetupData.transformData.rotation = (coords.rotation - drawData.cam.c.rotation) * 180.0 / std::numbers::pi; - drawSetupData.transformData.scale = static_cast(coords.inverseScale / drawData.cam.c.inverseScale); + drawSetupData.transformData.scale = std::min(static_cast(coords.inverseScale / drawData.cam.c.inverseScale), static_cast(1 << DRAWCOMP_MAX_SHIFT_BEFORE_DISAPPEAR)); } } } diff --git a/src/DrawComponents/DrawComponent.hpp b/src/DrawComponents/DrawComponent.hpp index d93354c..6819248 100644 --- a/src/DrawComponents/DrawComponent.hpp +++ b/src/DrawComponents/DrawComponent.hpp @@ -16,7 +16,7 @@ #define CLIENT_DRAWCOMP_DELAY_TIMER_DURATION std::chrono::seconds(6) -#define DRAWCOMP_MAX_SHIFT_BEFORE_DISAPPEAR 20 +#define DRAWCOMP_MAX_SHIFT_BEFORE_DISAPPEAR 18 #define DRAWCOMP_MIN_SHIFT_BEFORE_DISAPPEAR 11 #define DRAWCOMP_COLLIDE_MIN_SHIFT_TINY 9 #define DRAWCOMP_MIPMAP_LEVEL_ONE 2