mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Cleaned up usings, log warning when using user space unit other than 1, removed comment
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
using Core;
|
using Core;
|
||||||
using Filters;
|
using Filters;
|
||||||
using Geometry;
|
using Geometry;
|
||||||
|
using Logging;
|
||||||
using Operations;
|
using Operations;
|
||||||
using Parser;
|
using Parser;
|
||||||
using PdfFonts;
|
using PdfFonts;
|
||||||
@@ -19,8 +20,6 @@
|
|||||||
using Util;
|
using Util;
|
||||||
using XObjects;
|
using XObjects;
|
||||||
using static PdfPig.Core.PdfSubpath;
|
using static PdfPig.Core.PdfSubpath;
|
||||||
using System.Drawing;
|
|
||||||
using System.Numerics;
|
|
||||||
|
|
||||||
internal class ContentStreamProcessor : IOperationContext
|
internal class ContentStreamProcessor : IOperationContext
|
||||||
{
|
{
|
||||||
@@ -111,7 +110,7 @@
|
|||||||
|
|
||||||
graphicsStack.Push(new CurrentGraphicsState()
|
graphicsStack.Push(new CurrentGraphicsState()
|
||||||
{
|
{
|
||||||
CurrentTransformationMatrix = GetInitialMatrix(userSpaceUnit, mediaBox, cropBox, rotation),
|
CurrentTransformationMatrix = GetInitialMatrix(userSpaceUnit, mediaBox, cropBox, rotation, parsingOptions.Logger),
|
||||||
CurrentClippingPath = clippingPath
|
CurrentClippingPath = clippingPath
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -122,7 +121,8 @@
|
|||||||
internal static TransformationMatrix GetInitialMatrix(UserSpaceUnit userSpaceUnit,
|
internal static TransformationMatrix GetInitialMatrix(UserSpaceUnit userSpaceUnit,
|
||||||
MediaBox mediaBox,
|
MediaBox mediaBox,
|
||||||
CropBox cropBox,
|
CropBox cropBox,
|
||||||
PageRotationDegrees rotation)
|
PageRotationDegrees rotation,
|
||||||
|
ILog log)
|
||||||
{
|
{
|
||||||
// Cater for scenario where the cropbox is larger than the mediabox.
|
// Cater for scenario where the cropbox is larger than the mediabox.
|
||||||
// If there is no intersection (method returns null), fall back to the cropbox.
|
// If there is no intersection (method returns null), fall back to the cropbox.
|
||||||
@@ -139,13 +139,10 @@
|
|||||||
// Move points so that (0,0) is equal to the viewbox bottom left corner.
|
// Move points so that (0,0) is equal to the viewbox bottom left corner.
|
||||||
var t1 = TransformationMatrix.GetTranslationMatrix(-viewBox.Left, -viewBox.Bottom);
|
var t1 = TransformationMatrix.GetTranslationMatrix(-viewBox.Left, -viewBox.Bottom);
|
||||||
|
|
||||||
// Not implemented yet: userSpaceUnit
|
if (userSpaceUnit.PointMultiples != 1)
|
||||||
// if (userSpaceUnit.PointMultiples != 1)
|
{
|
||||||
// {
|
log.Warn("User space unit other than 1 is not implemented");
|
||||||
// var scale = TransformationMatrix.GetScaleMatrix(userSpaceUnit.PointMultiples,
|
}
|
||||||
// userSpaceUnit.PointMultiples);
|
|
||||||
// ....
|
|
||||||
// }
|
|
||||||
|
|
||||||
// After rotating around the origin, our points will have negative x/y coordinates.
|
// After rotating around the origin, our points will have negative x/y coordinates.
|
||||||
// Fix this by translating them by a certain dx/dy after rotation based on the viewbox.
|
// Fix this by translating them by a certain dx/dy after rotation based on the viewbox.
|
||||||
|
|||||||
@@ -178,7 +178,6 @@
|
|||||||
DirectObjectFinder.Get<NumericToken>(array[3], tokenScanner).Double);
|
DirectObjectFinder.Get<NumericToken>(array[3], tokenScanner).Double);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Can this be removed? Seems unused but is public method
|
|
||||||
public static PdfRectangle ToIntRectangle(this ArrayToken array, IPdfTokenScanner tokenScanner)
|
public static PdfRectangle ToIntRectangle(this ArrayToken array, IPdfTokenScanner tokenScanner)
|
||||||
{
|
{
|
||||||
if (array == null)
|
if (array == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user