Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Calling offset method when rectangle is empty. (Read 712 times)
nullable
Junior Member
**
Offline


I Love MindFusion!

Posts: 86
Joined: Aug 25th, 2022
Calling offset method when rectangle is empty.
Apr 3rd, 2023 at 8:04am
Print Post  
Hello mindfusion team!

I just wanted to know if there is possibility of avoiding empty rectangles when calling method Rect.Offset() in SvgExporter.Export()? I get the following exception when all diagram items don't have empty bounds and don't have NaN height or width.
Code
Select All
2023-03-28 11:05:29.8787|Fatal|Unexpected error occurred. | System.InvalidOperationException: Cannot call this method on the Empty Rect.
   at System.Windows.Rect.Offset(Double offsetX, Double offsetY)
   at MindFusion.Diagramming.Wpf.Export.SvgExporter.(DrawingGroup , Transform , Geometry , Geometry )
   at MindFusion.Diagramming.Wpf.Export.SvgExporter.(DrawingGroup , Transform , Geometry , Geometry )
   at MindFusion.Diagramming.Wpf.Export.SvgExporter.(Visual , Geometry )
   at MindFusion.Diagramming.Wpf.Export.SvgExporter.(Visual , Transform , Geometry )
   at MindFusion.Diagramming.Wpf.Export.SvgExporter.(DrawingGroup , Transform , Geometry , Geometry )
   at MindFusion.Diagramming.Wpf.Export.SvgExporter.(Diagram , String )
   at MindFusion.Diagramming.Wpf.Export.SvgExporter.Export(Diagram diagram, Stream stream)
 

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Calling offset method when rectangle is empty.
Reply #1 - Apr 4th, 2023 at 10:30am
Print Post  
Hi,

SvgExporter calls that only on GlyphRun boundaries and we can't think of why would be empty. Please post exact text and font with which you are seeing the error.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Junior Member
**
Offline


I Love MindFusion!

Posts: 86
Joined: Aug 25th, 2022
Re: Calling offset method when rectangle is empty.
Reply #2 - Apr 6th, 2023 at 4:59am
Print Post  
Nevermind. It turned out the problem was with text with "-" symbol and whitespaces around it. For example, "text - text" caused this error during exporting, but it seems you've fixed it. Well done Wink
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint