@@ -46,7 +46,7 @@ impl<F: CoordNum> PathBuilder<F> {
4646 }
4747
4848 /// Get the current position to be used for relative moves.
49- fn get_pos ( & self ) -> Coord < F > {
49+ fn get_position ( & self ) -> Coord < F > {
5050 self . inner
5151 . 0
5252 . last ( )
@@ -69,7 +69,7 @@ impl<F: CoordNum> PathBuilder<F> {
6969 . unwrap_or ( false ) ;
7070
7171 if start_new_path {
72- self . inner . 0 . push ( LineString :: new ( vec ! [ self . get_pos ( ) ] ) ) ;
72+ self . inner . 0 . push ( LineString :: new ( vec ! [ self . get_position ( ) ] ) ) ;
7373 }
7474
7575 self . inner . 0 . last_mut ( ) . ok_or_else ( || {
@@ -87,8 +87,8 @@ impl<F: CoordNum> PathBuilder<F> {
8787 /// Start a new path at `delta` relative to the last point.
8888 /// If and only if this is the first command, the point is treated as absolute coordinates.
8989 pub fn move_by ( & mut self , delta : Coord < F > ) {
90- let pos = self . get_pos ( ) ;
91- self . inner . 0 . push ( LineString :: new ( vec ! [ pos + delta] ) ) ;
90+ let position = self . get_position ( ) ;
91+ self . inner . 0 . push ( LineString :: new ( vec ! [ position + delta] ) ) ;
9292 }
9393
9494 /// Extend the current path to the `point`.
@@ -102,16 +102,16 @@ impl<F: CoordNum> PathBuilder<F> {
102102 /// Extend the current path by `delta` relative to the current point.
103103 /// Can not be the first command.
104104 pub fn line_by ( & mut self , delta : Coord < F > ) -> Result < ( ) , IoError > {
105- let pos = self . get_pos ( ) ;
105+ let position = self . get_position ( ) ;
106106 let line = self . get_path_mut_or_fail ( ) ?;
107- line. 0 . push ( pos + delta) ;
107+ line. 0 . push ( position + delta) ;
108108 Ok ( ( ) )
109109 }
110110
111111 /// Extend the current path with a horizontal move to `x`.
112112 /// Can not be the first command.
113113 pub fn hline_to ( & mut self , x : F ) -> Result < ( ) , IoError > {
114- let Coord { y, .. } = self . get_pos ( ) ;
114+ let Coord { y, .. } = self . get_position ( ) ;
115115 let line = self . get_path_mut_or_fail ( ) ?;
116116 line. 0 . push ( Coord { x, y } ) ;
117117 Ok ( ( ) )
@@ -120,7 +120,7 @@ impl<F: CoordNum> PathBuilder<F> {
120120 /// Extend the current path with a horizontal move by `dx` relative to the current point.
121121 /// Can not be the first command.
122122 pub fn hline_by ( & mut self , dx : F ) -> Result < ( ) , IoError > {
123- let Coord { x, y } = self . get_pos ( ) ;
123+ let Coord { x, y } = self . get_position ( ) ;
124124 let line = self . get_path_mut_or_fail ( ) ?;
125125 line. 0 . push ( Coord { x : x + dx, y } ) ;
126126 Ok ( ( ) )
@@ -129,7 +129,7 @@ impl<F: CoordNum> PathBuilder<F> {
129129 /// Extend the current path with a vertical move to `y`.
130130 /// Can not be the first command.
131131 pub fn vline_to ( & mut self , y : F ) -> Result < ( ) , IoError > {
132- let Coord { x, .. } = self . get_pos ( ) ;
132+ let Coord { x, .. } = self . get_position ( ) ;
133133 let line = self . get_path_mut_or_fail ( ) ?;
134134 line. 0 . push ( Coord { x, y } ) ;
135135 Ok ( ( ) )
@@ -138,7 +138,7 @@ impl<F: CoordNum> PathBuilder<F> {
138138 /// Extend the current path with a vertical move by `dy` relative to the current point.
139139 /// Can not be the first command.
140140 pub fn vline_by ( & mut self , dy : F ) -> Result < ( ) , IoError > {
141- let Coord { x, y } = self . get_pos ( ) ;
141+ let Coord { x, y } = self . get_position ( ) ;
142142 let line = self . get_path_mut_or_fail ( ) ?;
143143 line. 0 . push ( Coord { x, y : y + dy } ) ;
144144 Ok ( ( ) )
0 commit comments