File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -87,12 +87,17 @@ private Ticks computeBounds() {
87
87
minY = Double .POSITIVE_INFINITY ;
88
88
maxY = Double .NEGATIVE_INFINITY ;
89
89
for (Graph g : graphs ) {
90
- double bMin = g .buffer .min () / 2.0 ;
91
- double bMax = g .buffer .max () * 2.0 ;
92
- minY = bMin < minY ? bMin : minY ;
93
- maxY = bMax > maxY ? bMax : maxY ;
90
+ minY = Math .min (g .buffer .min (), minY );
91
+ maxY = Math .max (g .buffer .max (), maxY );
94
92
}
95
-
93
+
94
+ final double MIN_DELTA = 10.0 ;
95
+ if (maxY - minY < MIN_DELTA ) {
96
+ double mid = (maxY + minY ) / 2 ;
97
+ maxY = mid + MIN_DELTA / 2 ;
98
+ minY = mid - MIN_DELTA / 2 ;
99
+ }
100
+
96
101
Ticks ticks = new Ticks (minY , maxY , 3 );
97
102
minY = Math .min (minY , ticks .getTick (0 ));
98
103
maxY = Math .max (maxY , ticks .getTick (ticks .getTickCount () - 1 ));
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ ARDUINO 1.6.8
5
5
* Fixed incorrect key bindings handling for changing tab. Thanks @matthijskooijman
6
6
* MacOSX: Fixed handling of add indent/remove indent shortcuts (CMD+[ and CMD+])
7
7
* Fixed incorrect update of available libraries in Library Manager. Thanks @vicnevicne
8
+ * Serial plotter now correctly resize graphs with negative values. Thanks @vicnevicne
8
9
9
10
[core]
10
11
* avr: fixed USB_SendControl(...) for buffer with len > 64. Thanks @NicoHood
You can’t perform that action at this time.
0 commit comments