[librsvg] cargo fmt
- From: Jordan Petridis <jpetridis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] cargo fmt
- Date: Sat, 16 Feb 2019 01:20:15 +0000 (UTC)
commit f416e4365d3350dd384abcc32397843f5b296b50
Author: Jordan Petridis <jordan centricular com>
Date: Sat Feb 16 03:19:51 2019 +0200
cargo fmt
.rustfmt.toml | 1 -
rsvg_internals/src/lib.rs | 5 +--
rsvg_internals/src/shapes.rs | 90 ++++++++++++++++++++++++++++++--------------
3 files changed, 62 insertions(+), 34 deletions(-)
---
diff --git a/.rustfmt.toml b/.rustfmt.toml
index 1dabca43..3ff19eec 100644
--- a/.rustfmt.toml
+++ b/.rustfmt.toml
@@ -11,5 +11,4 @@ format_strings = true
normalize_comments = true
reorder_imports = true
use_field_init_shorthand = true
-imports_indent = "Block"
imports_layout = "HorizontalVertical"
diff --git a/rsvg_internals/src/lib.rs b/rsvg_internals/src/lib.rs
index 2d5d05be..e6068dca 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -35,10 +35,7 @@ extern crate xml as xml_rs;
#[macro_use]
extern crate lazy_static;
-pub use c_api::{
- rsvg_rust_error_get_type,
- rsvg_rust_handle_flags_get_type,
-};
+pub use c_api::{rsvg_rust_error_get_type, rsvg_rust_handle_flags_get_type};
pub use color::{rsvg_css_parse_color, ColorKind, ColorSpec};
diff --git a/rsvg_internals/src/shapes.rs b/rsvg_internals/src/shapes.rs
index c0274214..98d7b1d6 100644
--- a/rsvg_internals/src/shapes.rs
+++ b/rsvg_internals/src/shapes.rs
@@ -488,46 +488,78 @@ impl NodeTrait for NodeRect {
let top_x1 = x + rx;
let top_x2 = x + w - rx;
- let top_y = y;
+ let top_y = y;
let bottom_x1 = top_x1;
let bottom_x2 = top_x2;
- let bottom_y = y + h;
+ let bottom_y = y + h;
- let left_x = x;
+ let left_x = x;
let left_y1 = y + ry;
let left_y2 = y + h - ry;
- let right_x = x + w;
+ let right_x = x + w;
let right_y1 = left_y1;
let right_y2 = left_y2;
- builder.move_to (top_x1, top_y);
- builder.line_to (top_x2, top_y);
+ builder.move_to(top_x1, top_y);
+ builder.line_to(top_x2, top_y);
+
+ builder.arc(
+ top_x2,
+ top_y,
+ rx,
+ ry,
+ 0.0,
+ LargeArc(false),
+ Sweep::Positive,
+ right_x,
+ right_y1,
+ );
+
+ builder.line_to(right_x, right_y2);
+
+ builder.arc(
+ right_x,
+ right_y2,
+ rx,
+ ry,
+ 0.0,
+ LargeArc(false),
+ Sweep::Positive,
+ bottom_x2,
+ bottom_y,
+ );
+
+ builder.line_to(bottom_x1, bottom_y);
+
+ builder.arc(
+ bottom_x1,
+ bottom_y,
+ rx,
+ ry,
+ 0.0,
+ LargeArc(false),
+ Sweep::Positive,
+ left_x,
+ left_y2,
+ );
+
+ builder.line_to(left_x, left_y1);
+
+ builder.arc(
+ left_x,
+ left_y1,
+ rx,
+ ry,
+ 0.0,
+ LargeArc(false),
+ Sweep::Positive,
+ top_x1,
+ top_y,
+ );
- builder.arc (top_x2, top_y,
- rx, ry, 0.0, LargeArc (false), Sweep::Positive,
- right_x, right_y1);
-
- builder.line_to (right_x, right_y2);
-
- builder.arc (right_x, right_y2,
- rx, ry, 0.0, LargeArc (false), Sweep::Positive,
- bottom_x2, bottom_y);
-
- builder.line_to (bottom_x1, bottom_y);
-
- builder.arc (bottom_x1, bottom_y,
- rx, ry, 0.0, LargeArc (false), Sweep::Positive,
- left_x, left_y2);
-
- builder.line_to (left_x, left_y1);
-
- builder.arc (left_x, left_y1,
- rx, ry, 0.0, LargeArc (false), Sweep::Positive,
- top_x1, top_y);
-
- builder.close_path ();
+ builder.close_path();
}
render_path_builder(&builder, draw_ctx, node, values, false, clipping)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]