Use default width/height to draw when there is no valid pressure/touch_major

I am playing around with AcerT232HL touch monitor. The touch screen
does not report PRESSURE nor TOUCH_MAJOR value. Lets have a default
width/height value for drawing in this case.

BUG=chromium:255049
TEST=mtplot works with AcerT232HL

Change-Id: I9577bc0ad3b56f39bc58ec9e64e86284eab7e336
Reviewed-on: https://gerrit.chromium.org/gerrit/60257
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
diff --git a/mtplot.c b/mtplot.c
index 49608d3..fad9192 100644
--- a/mtplot.c
+++ b/mtplot.c
@@ -585,12 +585,15 @@
         (float)(s->pressure - pressure_min) / (pressure_max - pressure_min + 1);
     height = 50.0 *
         (float)(s->pressure - pressure_min) / (pressure_max - pressure_min + 1);
-  } else {
+  } else if (s->touch_major) {
     // In case we don't have pressure reading, use touch_major instead.
     width = 50.0 * (float)(s->touch_major - touch_major_min) /
         (touch_major_max - touch_major_min + 1);
     height = 50.0 * (float)(s->touch_major - touch_major_min) /
         (touch_major_max - touch_major_min + 1);
+  } else {
+    width = 10;
+    height = 10;
   }
 
   x_pixel = s->x * pad_to_pixel + pad_x_offset;