From a9e12f6c508810604c8c91ee15451776b08ce1a1 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 22 Apr 2019 07:41:56 -0400
Subject: [PATCH] Camera capslock fix

---
 timeflow/vis/timeline/AxisRenderer.java |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/timeflow/vis/timeline/AxisRenderer.java b/timeflow/vis/timeline/AxisRenderer.java
index 0372be6..7c16246 100755
--- a/timeflow/vis/timeline/AxisRenderer.java
+++ b/timeflow/vis/timeline/AxisRenderer.java
@@ -20,7 +20,7 @@
 
         public void render(Graphics2D g, Collection<Mouseover> objectLocations)
         {
-                TFModel model = visuals.getModel();
+                TimeflowModel model = visuals.getModel();
                 g.setColor(model.getDisplay().getColor("chart.background"));
                 Rectangle bounds = visuals.getBounds();
 
@@ -41,12 +41,11 @@
 
         void render(AxisTicMarks t, Graphics2D g, int x, int y, int h, int top, boolean full, Collection<Mouseover> objectLocations)
         {
-                TFModel model = visuals.getModel();
+                TimeflowModel model = visuals.getModel();
 
                 int n = t.tics.size();
                 for (int i = 0; i < n - 1; i++)
                 {
-
                         long start = t.tics.get(i);
                         long end = t.tics.get(i + 1);
 
@@ -58,19 +57,23 @@
                         g.setColor(t.unit.isDayOrLess() && (dayOfWeek == 1 || dayOfWeek == 7)
                                 ? new Color(245, 245, 245) : new Color(240, 240, 240));
 
-                        g.fillRect(x0, y, x1 - x0 - 1, h);
+                        g.fillRect(x0, y, x1 - x0, h);
                         g.setColor(Color.white);
-                        g.drawLine(x1 - 1, y, x1 - 1, y + h);
+                        g.drawLine(x1, y, x1, y + h);
                         g.drawLine(x0, y + h, x1, y + h);
-                        objectLocations.add(new Mouseover(new Interval(start, end), x0, y, x1 - x0 - 1, h));
+                        objectLocations.add(new Mouseover(new Interval(start, end), x0, y, x1 - x0, h));
 
                         g.setFont(model.getDisplay().timeLabel());
                         String label = full ? t.unit.formatFull(start) : t.unit.format(new Date(start));
-                        int tx = x0 + 3;
-                        int ty = y + h - 5;
+                        
+                        if (!full)
+                                full = false;
+                        
+                        int tx = x0;
+                        int ty = y + h;
                         g.setColor(full ? Color.darkGray : Color.gray);
                         int sw = model.getDisplay().timeLabelFontMetrics().stringWidth(label);
-                        if (sw < x1 - tx - 3)
+                        if (true) // sw < x1 - tx)
                         {
                                 g.drawString(label, tx, ty);
                         } else
@@ -80,7 +83,7 @@
                                 {
                                         label = label.substring(0, c);
                                         sw = model.getDisplay().timeLabelFontMetrics().stringWidth(label);
-                                        if (sw < x1 - tx - 3)
+                                        //if (sw < x1 - tx)
                                         {
                                                 g.drawString(label, tx, ty);
                                         }

--
Gitblit v1.6.2