First, thank you for the fantastic library!
The symptom I am seeing is that calling SetPosition on a chart correctly moves the chart but also changes the height.
I downloaded and debugged into the code and found the problem in the GetRowWidth method. After the cast to RowInternal, there should be a check that RowInternal.Height is >= 0 before using the Height value because it may be -1. Otherwise the default height should be returned.
For comparison see the ExcelRow.Height property which has this check.
I include my fixed version of the method below if it is of any use:
private double GetRowWidth(int row)
{
ExcelWorksheet ws = _drawings.Worksheet;
object o = null;
if (ws._values.Exists(row, 0, ref o) && o != null) //Check that the row exists
{
var internalRow = (RowInternal)o;
if (internalRow.Height >= 0)
{
return internalRow.Height;
}
}
return (double)ws.DefaultRowHeight;
}
The symptom I am seeing is that calling SetPosition on a chart correctly moves the chart but also changes the height.
I downloaded and debugged into the code and found the problem in the GetRowWidth method. After the cast to RowInternal, there should be a check that RowInternal.Height is >= 0 before using the Height value because it may be -1. Otherwise the default height should be returned.
For comparison see the ExcelRow.Height property which has this check.
I include my fixed version of the method below if it is of any use:
private double GetRowWidth(int row)
{
ExcelWorksheet ws = _drawings.Worksheet;
object o = null;
if (ws._values.Exists(row, 0, ref o) && o != null) //Check that the row exists
{
var internalRow = (RowInternal)o;
if (internalRow.Height >= 0)
{
return internalRow.Height;
}
}
return (double)ws.DefaultRowHeight;
}