File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " app_units"
3
- version = " 0.5.4 "
3
+ version = " 0.5.5 "
4
4
authors = [" The Servo Project Developers" ]
5
5
description = " Servo app units type (Au)"
6
6
documentation = " http://doc.servo.org/app_units/"
Original file line number Diff line number Diff line change @@ -195,18 +195,18 @@ impl Au {
195
195
#[ inline]
196
196
pub fn scale_by ( self , factor : f32 ) -> Au {
197
197
let new_float = ( ( self . 0 as f64 ) * factor as f64 ) . round ( ) ;
198
- Au :: clamp_from_f64_au ( new_float)
198
+ Au :: from_f64_au ( new_float)
199
199
}
200
200
201
201
#[ inline]
202
202
/// Scale, but round down (useful for viewport-relative units)
203
203
pub fn scale_by_trunc ( self , factor : f32 ) -> Au {
204
204
let new_float = ( ( self . 0 as f64 ) * factor as f64 ) . floor ( ) ;
205
- Au :: clamp_from_f64_au ( new_float)
205
+ Au :: from_f64_au ( new_float)
206
206
}
207
207
208
208
#[ inline]
209
- fn clamp_from_f64_au ( float : f64 ) -> Self {
209
+ pub fn from_f64_au ( float : f64 ) -> Self {
210
210
// We *must* operate in f64. f32 isn't precise enough
211
211
// to handle MAX_AU
212
212
Au ( float. min ( MAX_AU . 0 as f64 )
@@ -254,13 +254,13 @@ impl Au {
254
254
#[ inline]
255
255
pub fn from_f32_px ( px : f32 ) -> Au {
256
256
let float = ( px * AU_PER_PX as f32 ) . round ( ) ;
257
- Au :: clamp_from_f64_au ( float as f64 )
257
+ Au :: from_f64_au ( float as f64 )
258
258
}
259
259
260
260
#[ inline]
261
261
pub fn from_f64_px ( px : f64 ) -> Au {
262
262
let float = ( px * AU_PER_PX as f64 ) . round ( ) ;
263
- Au :: clamp_from_f64_au ( float)
263
+ Au :: from_f64_au ( float)
264
264
}
265
265
266
266
#[ inline]
You can’t perform that action at this time.
0 commit comments