Thanks, it's working but I'm still facing an issue:
In my DrawCell event handler I calculate the size of the custom check box to be drawn, using the DiagramView.ZoomFactor:
float newCheckImageWidth = chkImg.Width * view.ZoomFactor / 100;
float newCheckImageHeight = chkImg.Height * view.ZoomFactor / 100;
Obviously, in the Overview, the checkboxes are drawn too big.
I would check if the sender is an Overview and in this case I would multiply the check box width/height also by Overview.ScaleFactor but the "sender" parameter is always set to the Diagram so I can't make the difference on when it's called to paint the Diagram and when it's called to paint the Overview.
So, I tried to change the way the checkbox size is updated (to remove the DiagramView.ZoomFactor dependency ) , by using only the current painted row height like:
double newCheckImageWidth = Math.Floor(contentBoundsView.Height * 0.6);
double newCheckImageHeight = newCheckImageWidth;
But even if I Math.Floor the result, I can get different values because the row height is not always the same:
For example, I have
Rectangle boundsView = MindFusion.Utilities.DocToDevice(g, e.Bounds);
SizeF sizeViewF = MindFusion.Utilities.DocToDeviceF(g, e.Bounds.Size);
The sizeViewF returns for every row W= 6.803... H=6.803... but the boundsView returns for some rows W=7 H=7 (as it should) and for others W=7 H=6.
I don't understand why DocToDevice returns different values for height when e.Bound.Height is the same for every rows and also DocToDeviceF returns same height for every row. Is it a bug?
Should I manually correct the
height of the "boundsView" to make it equal to the
height returned by the "sizeViewF"?
PS. Id I use the view.DocToClient I get the same inconsistency regarding the returned height.