reduce variable scope

This commit is contained in:
Antony Corbett
2023-02-13 17:06:15 +00:00
parent 30bd7420e2
commit 4f097d0fed
+4 -3
View File
@@ -32,16 +32,17 @@ namespace QuestPDF.Fluent
if (image == null)
throw new DocumentComposeException("Cannot load or decode provided image.");
var aspectRatio = image.Width / (float)image.Height;
var imageElement = new Image
{
InternalImage = image
};
if (scaling != ImageScaling.Resize)
{
var aspectRatio = image.Width / (float)image.Height;
parent = parent.AspectRatio(aspectRatio, Map(scaling));
}
parent.Element(imageElement);
static AspectRatioOption Map(ImageScaling scaling)