summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2014-10-17 20:13:23 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2014-10-17 20:14:44 +0100
commit1cbf064db5130438cbc7153f121b535fcea56e41 (patch)
tree6c4543ee2b3941b86540d72914f4ccc277b3b1df
parent3a0793fe12c04006ad98875fc2a105c471850a78 (diff)
downloadfpGUI-1cbf064db5130438cbc7153f121b535fcea56e41.tar.xz
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.
-rw-r--r--src/corelib/fpg_base.pas3
1 files changed, 3 insertions, 0 deletions
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;