[chronojump] Encoder secondary variable circle diameter shorter on small drawingarea



commit e149815b179d3bc850bf1631d981059a94efbcd2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Feb 20 11:13:08 2020 +0100

    Encoder secondary variable circle diameter shorter on small drawingarea

 src/gui/encoderGraphObjects.cs | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/encoderGraphObjects.cs b/src/gui/encoderGraphObjects.cs
index 84a2c736..ba682994 100644
--- a/src/gui/encoderGraphObjects.cs
+++ b/src/gui/encoderGraphObjects.cs
@@ -800,10 +800,17 @@ public class EncoderGraphDoPlot
                //plot the secondary variable stuff
                foreach(EncoderBarsSecondaryLine ebsl in encoderBarsSecondaryLine_l)
                {
+                       //12 is nice for 1920*1080, but for small screens that radius is too high
+                       int diameter = 12;
+                       if(graphWidth * graphHeight < 1000000)
+                               diameter = 9;
+
+                       //circle
                        pixmap.DrawArc(pen_yellow_encoder_capture, true,
-                                       ebsl.current.X -6, ebsl.current.Y -6,
-                                       12, 12, 90 * 64, 360 * 64);
+                                       ebsl.current.X -diameter/2, ebsl.current.Y -diameter/2,
+                                       diameter, diameter, 90 * 64, 360 * 64);
 
+                       //line
                        if(ebsl.pre.X != 0 && ebsl.pre.Y != 0)
                                pixmap.DrawLine(pen_yellow_encoder_capture, ebsl.pre.X, ebsl.pre.Y, 
ebsl.current.X, ebsl.current.Y);
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]