box drawing intersections
[fanfix.git] / src / jexer / TSpinner.java
index cdc5c0f4ed9b5bee9d9dda45e708e0cd471c56f8..ba45f6a64794b2d638a08f8a6fe3b1cf6d0036c9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The MIT License (MIT)
  *
- * Copyright (C) 2017 Kevin Lamonte
+ * Copyright (C) 2019 Kevin Lamonte
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -89,7 +89,7 @@ public class TSpinner extends TWidget {
      */
     private boolean mouseOnUpArrow(final TMouseEvent mouse) {
         if ((mouse.getY() == 0)
-            && (mouse.getX() == getWidth() - 1)
+            && (mouse.getX() == getWidth() - 2)
         ) {
             return true;
         }
@@ -104,7 +104,7 @@ public class TSpinner extends TWidget {
      */
     private boolean mouseOnDownArrow(final TMouseEvent mouse) {
         if ((mouse.getY() == 0)
-            && (mouse.getX() == getWidth() - 2)
+            && (mouse.getX() == getWidth() - 1)
         ) {
             return true;
         }
@@ -162,10 +162,8 @@ public class TSpinner extends TWidget {
             spinnerColor = getTheme().getColor("tspinner.inactive");
         }
 
-        getScreen().putCharXY(getWidth() - 2, 0, GraphicsChars.UPARROW,
-            spinnerColor);
-        getScreen().putCharXY(getWidth() - 1, 0, GraphicsChars.DOWNARROW,
-            spinnerColor);
+        putCharXY(getWidth() - 2, 0, GraphicsChars.UPARROW, spinnerColor);
+        putCharXY(getWidth() - 1, 0, GraphicsChars.DOWNARROW, spinnerColor);
     }
 
     // ------------------------------------------------------------------------