Forráskód Böngészése

ComPDFKit.Tool(Win) - 修复直线测量原部分地方漏掉缩放比问题

liyuxuan 1 hónapja
szülő
commit
145a9e8e34
1 módosított fájl, 7 hozzáadás és 7 törlés
  1. 7 7
      Demo/Examples/ComPDFKit.Tool/DrawTool/AnnotEdit.cs

+ 7 - 7
Demo/Examples/ComPDFKit.Tool/DrawTool/AnnotEdit.cs

@@ -318,16 +318,16 @@ namespace ComPDFKit.Tool.DrawTool
             crossLine.Clear();
             rightLine.Clear();
             CPDFDistanceMeasure LineMeasure = Annot.GetDistanceMeasure();
-            double LeadLength = LineMeasure.GetLeadLength() / 72D * 96D;
-            double LeadOffset = LineMeasure.GetLeadOffset() / 72D * 96D;
-            double LeadExtension = LineMeasure.GetLeadExtension() / 72D * 96D;
+            double LeadLength = LineMeasure.GetLeadLength() / 72D * 96D * annotData.CurrentZoom;
+            double LeadOffset = LineMeasure.GetLeadOffset() / 72D * 96D * annotData.CurrentZoom;
+            double LeadExtension = LineMeasure.GetLeadExtension() / 72D * 96D * annotData.CurrentZoom;
 
             List<Point> orderPoints = activePoints.AsEnumerable().OrderBy(x => x.X).ToList();
-            Vector lineVector = (activePoints[1] - activePoints[0]) * annotData.CurrentZoom;
+            Vector lineVector = (activePoints[1] - activePoints[0]) ;
             lineVector.Normalize();
-            Vector leadEndVector = lineVector * (Math.Abs(LeadLength) + Math.Abs(LeadOffset) + Math.Abs(LeadExtension) * annotData.CurrentZoom);
-            Vector leadStartVector = lineVector * (Math.Abs(LeadOffset)) * annotData.CurrentZoom;
-            Vector leadCrossVector = lineVector * (Math.Abs(LeadLength)  * annotData.CurrentZoom + Math.Abs(LeadOffset));
+            Vector leadEndVector = lineVector * (Math.Abs(LeadLength) + Math.Abs(LeadOffset) + Math.Abs(LeadExtension));
+            Vector leadStartVector = lineVector * (Math.Abs(LeadOffset));
+            Vector leadCrossVector = lineVector * (Math.Abs(LeadLength) + Math.Abs(LeadOffset));
             Matrix rotateMatrix = new Matrix();
             double angle = LeadLength < 0 ? 90 : -90;
             rotateMatrix.Rotate(angle);