lanterna: update
authorNiki Roo <niki@nikiroo.be>
Mon, 29 Feb 2016 15:48:46 +0000 (16:48 +0100)
committerNiki Roo <niki@nikiroo.be>
Mon, 29 Feb 2016 15:48:46 +0000 (16:48 +0100)
lanterna/2016-02-29 - 16:20 lanterna-master.zip [new file with mode: 0644]
src/com/googlecode/lanterna/graphics/PropertiesTheme.java
src/com/googlecode/lanterna/gui2/AbstractWindow.java
src/com/googlecode/lanterna/gui2/InteractableLookupMap.java

diff --git a/lanterna/2016-02-29 - 16:20 lanterna-master.zip b/lanterna/2016-02-29 - 16:20 lanterna-master.zip
new file mode 100644 (file)
index 0000000..55f0f8e
Binary files /dev/null and b/lanterna/2016-02-29 - 16:20 lanterna-master.zip differ
index 40f61d1a8a11eff296233bc213fc029701025859..9ac8a60ba6496845ef6b8993268a3932c17f3ac1 100644 (file)
@@ -163,7 +163,8 @@ public final class PropertiesTheme implements Theme {
                     lastElement.backgroundMap.containsKey(name)) {
                 return new StyleImpl(path, name);
             }
-            return null;
+            // If there was no custom style with this name, just return the normal one
+            return getNormal();
         }
 
         @Override
index 6c9c5fdfab05742d32a5e52fd5c7994ac744a859..4e55f3d54d63d51556eeb2319592733de78ccf88 100644 (file)
@@ -123,7 +123,7 @@ public abstract class AbstractWindow extends AbstractBasePane implements Window
             getComponent().invalidate();
         }
         setSize(graphics.getSize(), false);
-       super.draw(graphics);
+        super.draw(graphics);
     }
 
     @Override
index 36d285ee56eb7c004191875b0adaa95f29979ec8..a200a302f40f6f51fbdd7953f0a8e48086794387 100644 (file)
@@ -136,6 +136,10 @@ public class InteractableLookupMap {
             }
         }
         startPosition = interactable.toBasePane(startPosition);
+        if(startPosition == null) {
+            // The structure has changed, our interactable is no longer inside the base pane!
+            return null;
+        }
         Set<Interactable> disqualified = getDisqualifiedInteractables(startPosition, true);
         TerminalSize size = getSize();
         int maxShiftLeft = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER).getColumn();
@@ -212,6 +216,10 @@ public class InteractableLookupMap {
             }
         }
         startPosition = interactable.toBasePane(startPosition);
+        if(startPosition == null) {
+            // The structure has changed, our interactable is no longer inside the base pane!
+            return null;
+        }
         Set<Interactable> disqualified = getDisqualifiedInteractables(startPosition, false);
         TerminalSize size = getSize();
         int maxShiftUp = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER).getRow();