From 443f54bf79dfef359c900179341b8591bcc3c00b Mon Sep 17 00:00:00 2001 From: Nikita Samoylov Date: Fri, 27 Sep 2024 12:52:36 +0300 Subject: [PATCH] AND-8558 DynamicShader crash on empty area --- .../vico/core/cartesian/layer/spec/SplitLine.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vico/core/src/main/java/com/patrykandpatrick/vico/core/cartesian/layer/spec/SplitLine.kt b/vico/core/src/main/java/com/patrykandpatrick/vico/core/cartesian/layer/spec/SplitLine.kt index a732b6135..913e840a2 100644 --- a/vico/core/src/main/java/com/patrykandpatrick/vico/core/cartesian/layer/spec/SplitLine.kt +++ b/vico/core/src/main/java/com/patrykandpatrick/vico/core/cartesian/layer/spec/SplitLine.kt @@ -90,9 +90,14 @@ public class SplitLine( /* right = */ bounds.right, /* bottom = */ bounds.bottom, ) - super.drawBackground(context, firstBounds, zeroLineYFraction, path, opacity) + + if (firstBounds.isEmpty.not()) { + super.drawBackground(context, firstBounds, zeroLineYFraction, path, opacity) + } backgroundShader = backgroundShaderSecond - super.drawBackground(context, secondBounds, zeroLineYFraction, path, opacity) + if (secondBounds.isEmpty.not()) { + super.drawBackground(context, secondBounds, zeroLineYFraction, path, opacity) + } backgroundShader = backgroundShaderFirst } }