From a571ec6fbbadccb2467c5bb4fadb2ad574f22eeb Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 2 Feb 2021 10:16:42 -0800 Subject: [PATCH] Fix GTK wxPrinterDC gradient fill radius All the other implementations use the rect width/height, not the diagonal --- src/gtk/print.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp index 7689010a76..8b85e1fcc7 100644 --- a/src/gtk/print.cpp +++ b/src/gtk/print.cpp @@ -1285,8 +1285,7 @@ void wxGtkPrinterDCImpl::DoGradientFillConcentric(const wxRect& rect, const wxCo wxCoord w = rect.width; wxCoord h = rect.height; - const double r2 = (w/2)*(w/2)+(h/2)*(h/2); - double radius = sqrt(r2); + const double radius = wxMin(w, h) / 2.0; unsigned char redI = initialColour.Red(); unsigned char blueI = initialColour.Blue();