File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
plotters/src/coord/ranged1d/types Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,11 @@ macro_rules! gen_key_points_comp {
141
141
' outer: loop {
142
142
let old_scale = scale;
143
143
for nxt in [ 2.0 , 5.0 , 10.0 ] . iter( ) {
144
- let mut new_left = range. 0 - rem_euclid( range. 0 , scale / nxt) ;
144
+ let mut new_left = range. 0 - rem_euclid( range. 0 , old_scale / nxt) ;
145
145
if new_left < range. 0 {
146
- new_left += scale / nxt;
146
+ new_left += old_scale / nxt;
147
147
}
148
- let new_right = range. 1 - rem_euclid( range. 1 , scale / nxt) ;
148
+ let new_right = range. 1 - rem_euclid( range. 1 , old_scale / nxt) ;
149
149
150
150
let npoints = 1 + ( ( new_right - new_left) / old_scale * nxt) as usize ;
151
151
@@ -420,5 +420,8 @@ mod test {
420
420
let points = coord. key_points ( 6 ) ;
421
421
assert_eq ! ( points. len( ) , 6 ) ;
422
422
assert_eq ! ( points[ 0 ] , 1.0 ) ;
423
+ let coord: RangedCoordf64 = ( 1.0 ..125.0 ) . into ( ) ;
424
+ let points = coord. key_points ( 12 ) ;
425
+ assert_eq ! ( points. len( ) , 12 ) ;
423
426
}
424
427
}
You can’t perform that action at this time.
0 commit comments