Merge pull request #493 from AntonyCorbett/var_scope_change_02

reduce variable scope
This commit is contained in:
Marcin Ziąbek
2023-03-06 11:08:53 +01:00
committed by GitHub
+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)