rustfmt

parent a3254d7e
Pipeline #37176 failed with stages
in 29 minutes and 46 seconds
......@@ -398,16 +398,12 @@ mod tests {
#[test]
fn check_nonnegative_works() {
assert!(
Length::parse_str("0", LengthDir::Both)
.and_then(|l| l.check_nonnegative())
.is_ok()
);
assert!(
Length::parse_str("-10", LengthDir::Both)
.and_then(|l| l.check_nonnegative())
.is_err()
);
assert!(Length::parse_str("0", LengthDir::Both)
.and_then(|l| l.check_nonnegative())
.is_ok());
assert!(Length::parse_str("-10", LengthDir::Both)
.and_then(|l| l.check_nonnegative())
.is_err());
}
#[test]
......
......@@ -1233,10 +1233,10 @@ mod directionality_tests {
#[test]
fn curve_with_coincident_control_points_has_no_directionality() {
assert!(
super::get_segment_directionalities(&curve(1.0, 2.0, 1.0, 2.0, 1.0, 2.0, 1.0, 2.0))
.is_none()
);
assert!(super::get_segment_directionalities(&curve(
1.0, 2.0, 1.0, 2.0, 1.0, 2.0, 1.0, 2.0
))
.is_none());
}
#[test]
......@@ -1284,20 +1284,18 @@ mod marker_tests {
let mut v = Vec::new();
assert!(
emit_markers_for_path_builder(
&builder,
&mut |marker_type: MarkerType,
x: f64,
y: f64,
computed_angle: f64|
-> Result<(), RenderingError> {
v.push((marker_type, x, y, computed_angle));
Ok(())
}
)
.is_ok()
);
assert!(emit_markers_for_path_builder(
&builder,
&mut |marker_type: MarkerType,
x: f64,
y: f64,
computed_angle: f64|
-> Result<(), RenderingError> {
v.push((marker_type, x, y, computed_angle));
Ok(())
}
)
.is_ok());
assert_eq!(
v,
......@@ -1321,20 +1319,18 @@ mod marker_tests {
let mut v = Vec::new();
assert!(
emit_markers_for_path_builder(
&builder,
&mut |marker_type: MarkerType,
x: f64,
y: f64,
computed_angle: f64|
-> Result<(), RenderingError> {
v.push((marker_type, x, y, computed_angle));
Ok(())
}
)
.is_ok()
);
assert!(emit_markers_for_path_builder(
&builder,
&mut |marker_type: MarkerType,
x: f64,
y: f64,
computed_angle: f64|
-> Result<(), RenderingError> {
v.push((marker_type, x, y, computed_angle));
Ok(())
}
)
.is_ok());
assert_eq!(
v,
......
......@@ -91,10 +91,11 @@ impl NodeChars {
let (width, _) = layout.get_size();
let baseline = f64::from(layout.get_baseline()) / f64::from(pango::SCALE);
let offset = baseline + values
.baseline_shift
.0
.normalize(values, &draw_ctx.get_view_params());
let offset = baseline
+ values
.baseline_shift
.0
.normalize(values, &draw_ctx.get_view_params());
if values.text_gravity_is_vertical() {
draw_ctx.draw_pango_layout(&layout, values, *x + offset, *y, clipping)?;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment