[librsvg/rustification] path_builder.rs: Rename path_data to path_segments to reflect its PathSegment elements
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] path_builder.rs: Rename path_data to path_segments to reflect its PathSegment elements
- Date: Wed, 2 Nov 2016 01:32:08 +0000 (UTC)
commit a6b9f7458bb3461ecb4312d95fecf242df220569
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Nov 1 17:47:42 2016 -0600
path_builder.rs: Rename path_data to path_segments to reflect its PathSegment elements
rust/src/path_builder.rs | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/rust/src/path_builder.rs b/rust/src/path_builder.rs
index d18374b..0ce54d4 100644
--- a/rust/src/path_builder.rs
+++ b/rust/src/path_builder.rs
@@ -2,27 +2,27 @@ extern crate cairo;
#[repr(C)]
pub struct RsvgPathBuilder {
- path_data: Vec<cairo::PathSegment>,
+ path_segments: Vec<cairo::PathSegment>,
last_move_to_index: Option<usize>
}
impl RsvgPathBuilder {
fn move_to (&mut self, x: f64, y: f64) {
- self.path_data.push (cairo::PathSegment::MoveTo ((x, y)));
- self.last_move_to_index = Some (self.path_data.len () - 1);
+ self.path_segments.push (cairo::PathSegment::MoveTo ((x, y)));
+ self.last_move_to_index = Some (self.path_segments.len () - 1);
}
fn line_to (&mut self, x: f64, y: f64) {
- self.path_data.push (cairo::PathSegment::LineTo ((x, y)));
+ self.path_segments.push (cairo::PathSegment::LineTo ((x, y)));
}
fn curve_to (&mut self, x2: f64, y2: f64, x3: f64, y3: f64, x4: f64, y4: f64) {
- self.path_data.push (cairo::PathSegment::CurveTo ((x2, y2), (x3, y3), (x4, y4)));
+ self.path_segments.push (cairo::PathSegment::CurveTo ((x2, y2), (x3, y3), (x4, y4)));
}
fn close_path (&mut self) {
if let Some (idx) = self.last_move_to_index {
- let segment = self.path_data[idx];
+ let segment = self.path_segments[idx];
if let cairo::PathSegment::MoveTo ((x, y)) = segment {
self.move_to (x, y);
@@ -36,7 +36,7 @@ impl RsvgPathBuilder {
#[no_mangle]
pub unsafe extern fn rsvg_path_builder_new () -> *mut RsvgPathBuilder {
let builder = RsvgPathBuilder {
- path_data: Vec::new (),
+ path_segments: Vec::new (),
last_move_to_index: None
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]