Lots of documents from my clients have negative SubPath lengths, causing all sorts of trouble. Seems the problem can quite easily be reproduced (see below).
Any ideas around this? Known bug? Any fix?
[TestMethod] public void SubPath_length_becomes_negative() { Module.CorelApp.ActiveDocument.Unit = Corel.Interop.VGCore.cdrUnit.cdrInch; var c1 = Module.CorelApp.ActiveDocument.CreateCurve(); var sp1 = c1.CreateSubPath(0, 0); sp1.AppendLineSegment(10000, 0); // This fails. Length is not 10000 but -8454.6600314960633. sp1.Length.Should().Be(10000); }
That makes sense, thanks for figuring it out! I guess it's a bit of a stretch to hope for increased precision in all core Corel calculations! :) But it would be nice of you could choose your "base" unit somehow, i.e. what integer=1 should represent. In my applications, I would gladly sacrifice sub-millimeter precision if that meant I could represent kilometer lengths without overflow.