mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
Further performance improvements in DocstrumBoundingBoxes
This commit is contained in:
parent
14e7024545
commit
b05dfac672
@ -467,6 +467,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get middle points
|
// Get middle points
|
||||||
|
|
||||||
|
#if NET6_0_OR_GREATER
|
||||||
|
Span<PdfPoint> ps = stackalloc PdfPoint[] { j.Point1, j.Point2, Aj.Value, Bj.Value };
|
||||||
|
|
||||||
|
if (dXj != 0)
|
||||||
|
{
|
||||||
|
ps.Sort(PdfPointXYComparer.Instance);
|
||||||
|
}
|
||||||
|
else if (dYj != 0)
|
||||||
|
{
|
||||||
|
ps.Sort(PdfPointYComparer.Instance);
|
||||||
|
}
|
||||||
|
#else
|
||||||
PdfPoint[] ps = [j.Point1, j.Point2, Aj.Value, Bj.Value];
|
PdfPoint[] ps = [j.Point1, j.Point2, Aj.Value, Bj.Value];
|
||||||
|
|
||||||
if (dXj != 0)
|
if (dXj != 0)
|
||||||
@ -477,6 +490,7 @@
|
|||||||
{
|
{
|
||||||
Array.Sort(ps, PdfPointYComparer.Instance);
|
Array.Sort(ps, PdfPointYComparer.Instance);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
PdfPoint Cj = ps[1];
|
PdfPoint Cj = ps[1];
|
||||||
PdfPoint Dj = ps[2];
|
PdfPoint Dj = ps[2];
|
||||||
|
Loading…
Reference in New Issue
Block a user