From e430484e8582249f23baffdc6e0047bef9cb7c1c Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Thu, 24 Mar 2022 13:54:38 +0100 Subject: [PATCH] Fixed zooming out --- QuestPDF.Previewer/InteractiveCanvas.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QuestPDF.Previewer/InteractiveCanvas.cs b/QuestPDF.Previewer/InteractiveCanvas.cs index edbfe7e..5d622fd 100644 --- a/QuestPDF.Previewer/InteractiveCanvas.cs +++ b/QuestPDF.Previewer/InteractiveCanvas.cs @@ -62,14 +62,14 @@ class InteractiveCanvas : ICustomDrawOperation private void LimitTranslate() { - if (TotalPagesHeight * Scale > Height) + if (TotalPagesHeight > Height / Scale) { TranslateY = Math.Min(TranslateY, MaxTranslateY); TranslateY = Math.Max(TranslateY, 0); } else { - TranslateY = -TotalPagesHeight / 2; + TranslateY = (TotalPagesHeight - Height / Scale) / 2; } if (Width / Scale < MaxWidth)