[librsvg/rustification] path_parser.rs: Place the emit_*() functions next to each other
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] path_parser.rs: Place the emit_*() functions next to each other
- Date: Tue, 8 Nov 2016 22:05:52 +0000 (UTC)
commit 56b30a4696bd3927a4463d6b536d2748e15264e1
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Nov 8 12:43:59 2016 -0600
path_parser.rs: Place the emit_*() functions next to each other
This way it's easier to spot patterns
rust/src/path_parser.rs | 43 +++++++++++++++++++++----------------------
1 files changed, 21 insertions(+), 22 deletions(-)
---
diff --git a/rust/src/path_parser.rs b/rust/src/path_parser.rs
index 6807e0a..ef12316 100644
--- a/rust/src/path_parser.rs
+++ b/rust/src/path_parser.rs
@@ -261,6 +261,16 @@ impl<'external> PathParser<'external> {
None
}
+ fn emit_move_to (&mut self, x: f64, y: f64) {
+ self.current_x = x;
+ self.current_y = y;
+ self.reflection_x = self.current_x;
+ self.reflection_y = self.current_y;
+
+ self.builder.move_to (self.current_x, self.current_y);
+ println! ("emitting moveto {} {}", self.current_x, self.current_y);
+ }
+
fn emit_line_to (&mut self, x: f64, y: f64) {
self.current_x = x;
self.current_y = y;
@@ -271,6 +281,17 @@ impl<'external> PathParser<'external> {
println! ("emitting lineto {} {}", self.current_x, self.current_y);
}
+ fn emit_curve_to (&mut self, x2: f64, y2: f64, x3: f64, y3: f64, x4: f64, y4: f64) {
+ self.current_x = x4;
+ self.current_y = y4;
+ self.reflection_x = x3;
+ self.reflection_y = y3;
+
+ self.builder.curve_to (x2, y2, x3, y3, x4, y4);
+
+ println! ("emitting curveto ({} {}) ({} {}) ({} {})", x2, y2, x3, y3, x4, y4);
+ }
+
fn lineto_argument_sequence (&mut self, absolute: bool) -> bool {
if let Some ((mut x, mut y)) = self.coordinate_pair () {
if !absolute {
@@ -299,16 +320,6 @@ impl<'external> PathParser<'external> {
}
}
- fn emit_move_to (&mut self, x: f64, y: f64) {
- self.current_x = x;
- self.current_y = y;
- self.reflection_x = self.current_x;
- self.reflection_y = self.current_y;
-
- self.builder.move_to (self.current_x, self.current_y);
- println! ("emitting moveto {} {}", self.current_x, self.current_y);
- }
-
fn moveto_argument_sequence (&mut self, absolute: bool, is_initial_moveto: bool) -> bool {
if let Some ((mut x, mut y)) = self.coordinate_pair () {
if is_initial_moveto {
@@ -539,18 +550,6 @@ impl<'external> PathParser<'external> {
false
}
- fn emit_curve_to (&mut self, x2: f64, y2: f64, x3: f64, y3: f64, x4: f64, y4: f64) {
- self.current_x = x4;
- self.current_y = y4;
- self.reflection_x = x3;
- self.reflection_y = y3;
-
- self.builder.curve_to (x2, y2, x3, y3, x4, y4);
-
- println! ("emitting curveto ({} {}) ({} {}) ({} {})", x2, y2, x3, y3, x4, y4);
-
- }
-
fn curveto_argument_sequence (&mut self, absolute: bool) -> bool {
if let Some ((mut x2, mut y2)) = self.coordinate_pair () {
assert! (self.optional_comma_whitespace ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]