CA-334613: Clip region within which performance graph lines are drawn

Sharp turns in the graph can result in the line being drawn outside of the box.
This change makes sure the line is only rendered within the input rectangle.

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2022-03-31 11:27:28 +01:00 committed by Danilo Del Busso
parent 51a400bf70
commit 7a3fe5ddee

View File

@ -43,6 +43,10 @@ namespace XenAdmin.Controls.CustomDataGraph
if (points.Count == 0)
return;
// CA-334613: Sharp turns in the graph can result in
// the line being drawn outside of the box
g.SetClip(r);
int index = points.FindIndex(dataPoint => dataPoint.Y < 0);
if (index >= 0)
{