From 1cbf064db5130438cbc7153f121b535fcea56e41 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 17 Oct 2014 20:13:23 +0100 Subject: Fixes "division by zero" error eg: Compile DocView and resize the contents panel all the way to the right. The gradient panel ends up having < 1 width, which means it is not visible any more, so really the GradientFill doesn't need to do anything. --- src/corelib/fpg_base.pas | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/fpg_base.pas b/src/corelib/fpg_base.pas index aa30c309..0da0557a 100644 --- a/src/corelib/fpg_base.pas +++ b/src/corelib/fpg_base.pas @@ -1747,6 +1747,9 @@ begin else count := ARect.Right - ARect.Left; + if count < 1 then + Exit; // there is nothing to paint + RDiff := RGBStop.Red - RGBStart.Red; GDiff := RGBStop.Green - RGBStart.Green; BDiff := RGBStop.Blue - RGBStart.Blue; -- cgit v1.2.3-70-g09d2