Do not draw when width or height is zero or negative
MODIFY
WalletWasabi.Fluent/Controls/LineChart.cs
WalletWasabi.Fluent/Controls/LineChart.cs
@@ -219,6 +219,11 @@ namespace WalletWasabi.Fluent.Controls
return;
}
+ if (state.AreaWidth <= 0 || state.AreaHeight <= 0)
+ {
+ return;
+ }
+
var deflate = 0.5;
var geometry = CreateFillGeometry(state.Points, state.AreaWidth, state.AreaHeight);
var transform = context.PushPreTransform(
@@ -242,6 +247,11 @@ namespace WalletWasabi.Fluent.Controls
return;
}
+ if (state.AreaWidth <= 0 || state.AreaHeight <= 0)
+ {
+ return;
+ }
+
var thickness = AreaStrokeThickness;
var dashStyle = AreaStrokeDashStyle;
var lineCap = AreaStrokeLineCap;
@@ -266,6 +276,11 @@ namespace WalletWasabi.Fluent.Controls
return;
}
+ if (state.AreaWidth <= 0 || state.AreaHeight <= 0)
+ {
+ return;
+ }
+
var thickness = CursorStrokeThickness;
var dashStyle = CursorStrokeDashStyle;
var lineCap = CursorStrokeLineCap;
@@ -291,6 +306,11 @@ namespace WalletWasabi.Fluent.Controls
return;
}
+ if (state.AreaWidth <= 0 || state.AreaHeight <= 0)
+ {
+ return;
+ }
+
var size = XAxisArrowSize;
var opacity = XAxisOpacity;
var thickness = XAxisStrokeThickness;
@@ -374,6 +394,11 @@ namespace WalletWasabi.Fluent.Controls
return;
}
+ if (state.AreaWidth <= 0 || state.AreaHeight <= 0)
+ {
+ return;
+ }
+
var size = YAxisArrowSize;
var opacity = YAxisOpacity;
var thickness = YAxisStrokeThickness;
@@ -405,6 +430,11 @@ namespace WalletWasabi.Fluent.Controls
return;
}
+ if (state.AreaWidth <= 0 || state.AreaHeight <= 0)
+ {
+ return;
+ }
+
var opacity = YAxisTitleOpacity;
var fontFamily = YAxisTitleFontFamily;
var fontStyle = YAxisTitleFontStyle;
@@ -447,6 +477,11 @@ namespace WalletWasabi.Fluent.Controls
return;
}
+ if (state.AreaWidth <= 0 || state.AreaHeight <= 0)
+ {
+ return;
+ }
+
var thickness = BorderThickness;
var radiusX = BorderRadiusX;
var radiusY = BorderRadiusY;

Do not draw when width or height is zero or negative