resizing fixes
[fanfix.git] / src / jexer / TText.java
index 4791fdc5e38e242e707a8ed97d64d618895463d1..e47a162c6f5fe7a38ca02381320d393bdace1a1e 100644 (file)
@@ -173,6 +173,31 @@ public class TText extends TScrollableWidget {
     // TScrollableWidget ------------------------------------------------------
     // ------------------------------------------------------------------------
 
+    /**
+     * Override TWidget's width: we need to set child widget widths.
+     *
+     * @param width new widget width
+     */
+    @Override
+    public void setWidth(final int width) {
+        super.setWidth(width);
+        hScroller.setWidth(getWidth() - 1);
+        vScroller.setX(getWidth() - 1);
+    }
+
+    /**
+     * Override TWidget's height: we need to set child widget heights.
+     * time.
+     *
+     * @param height new widget height
+     */
+    @Override
+    public void setHeight(final int height) {
+        super.setHeight(height);
+        hScroller.setY(getHeight() - 1);
+        vScroller.setHeight(getHeight() - 1);
+    }
+
     /**
      * Draw the text box.
      */