Skip to content

Commit

Permalink
Name refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinZiabek committed May 11, 2023
1 parent 461dcde commit 6b1de07
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Source/QuestPDF.Examples/Engine/SimpleDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public DocumentSettings GetSettings()
{
return new DocumentSettings()
{
RasterDpi = PageSizes.PointsPerInch * ImageScalingFactor
ImageRasterDpi = PageSizes.PointsPerInch * ImageScalingFactor
};
}

Expand Down
4 changes: 2 additions & 2 deletions Source/QuestPDF/Drawing/DocumentGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ internal static void ApplyDefaultImageConfiguration(this Element? content, Docum
{
if (x is QuestPDF.Elements.Image image)
{
image.TargetDpi ??= settings.RasterDpi;
image.TargetDpi ??= settings.ImageRasterDpi;
image.CompressionQuality ??= settings.ImageCompressionQuality;
}

if (x is QuestPDF.Elements.DynamicImage dynamicImage)
{
dynamicImage.TargetDpi ??= settings.RasterDpi;
dynamicImage.TargetDpi ??= settings.ImageRasterDpi;
dynamicImage.CompressionQuality ??= settings.ImageCompressionQuality;
}
});
Expand Down
2 changes: 1 addition & 1 deletion Source/QuestPDF/Drawing/ImageCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override void EndDocument()

public override void BeginPage(Size size)
{
var scalingFactor = Settings.RasterDpi / (float) PageSizes.PointsPerInch;
var scalingFactor = Settings.ImageRasterDpi / (float) PageSizes.PointsPerInch;
var imageInfo = new SKImageInfo((int) (size.Width * scalingFactor), (int) (size.Height * scalingFactor));

Surface = SKSurface.Create(imageInfo);
Expand Down
2 changes: 1 addition & 1 deletion Source/QuestPDF/Drawing/PdfCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static SKDocumentPdfMetadata MapMetadata(DocumentMetadata metadata, Docu
Creation = metadata.CreationDate,
Modified = metadata.ModifiedDate,

RasterDpi = documentSettings.RasterDpi,
RasterDpi = documentSettings.ImageRasterDpi,
EncodingQuality = documentSettings.ImageCompressionQuality.ToQualityValue(),
PdfA = documentSettings.PdfA
};
Expand Down
2 changes: 1 addition & 1 deletion Source/QuestPDF/Drawing/XpsCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private static SKDocument CreateXps(Stream stream, DocumentSettings documentSett
{
try
{
return SKDocument.CreateXps(stream, documentSettings.RasterDpi);
return SKDocument.CreateXps(stream, documentSettings.ImageRasterDpi);
}
catch (TypeInitializationException exception)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/QuestPDF/Infrastructure/DocumentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class DocumentSettings
/// When generating images, this parameter also controls the resolution of the generated content.
/// Default value is 144.
/// </summary>
public int RasterDpi { get; set; } = DefaultRasterDpi * 2;
public int ImageRasterDpi { get; set; } = DefaultRasterDpi * 2;

public ContentDirection ContentDirection { get; set; } = ContentDirection.LeftToRight;

Expand Down

0 comments on commit 6b1de07

Please sign in to comment.