Skip to content

Commit 4bbdee2

Browse files
committed
Delete unused items
1 parent 9465b91 commit 4bbdee2

1 file changed

Lines changed: 0 additions & 51 deletions

File tree

src/scale.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@ impl CoordToPdf {
9898
}
9999
}
100100

101-
/// Convert from x SVG source coordinates to PDF coordinates.
102-
pub fn x(&self, x: f64) -> f32 {
103-
self.px_to_pt(self.apply_x(x) * self.factor_x + self.offset_x)
104-
}
105-
106-
/// Convert from y SVG source coordinates to PDF coordinates.
107-
pub fn y(&self, y: f64) -> f32 {
108-
self.px_to_pt(self.height_y - (self.apply_y(y) * self.factor_y + self.offset_y))
109-
}
110-
111101
/// Convert from SVG source coordinates to PDF coordinates.
112102
pub fn point(&self, point: (f64, f64)) -> (f32, f32) {
113103
let (x, y) = self.apply(point);
@@ -117,28 +107,12 @@ impl CoordToPdf {
117107
)
118108
}
119109

120-
/// Convert from x PDF coordinates to SVG source coordinates.
121-
pub fn svg_x(&self, x: f32) -> f64 {
122-
(self.pt_to_px(x) - self.offset_x) / self.factor_x
123-
}
124-
125-
/// Convert from y PDF coordinates to SVG source coordinates.
126-
pub fn svg_y(&self, y: f32) -> f64 {
127-
(self.pt_to_px(y) - self.offset_y) / self.factor_y
128-
}
129-
130110
/// Convert from pixels to PDF points, disregarding any offsets or
131111
/// axis-specific scales.
132112
pub fn px_to_pt(&self, px: f64) -> f32 {
133113
(px * 72.0 / self.dpi) as f32
134114
}
135115

136-
/// Convert from PDF points to pixels, disregarding any offsets or
137-
/// axis-specific scales.
138-
pub fn pt_to_px(&self, pt: f32) -> f64 {
139-
pt as f64 * self.dpi / 72.0
140-
}
141-
142116
/// Get the offset from the X axis.
143117
pub fn offset_x(&self) -> f64 {
144118
self.offset_x
@@ -164,19 +138,6 @@ impl CoordToPdf {
164138
self.dpi
165139
}
166140

167-
/// Get the transformation matrix for this converter.
168-
pub fn matrix(&self) -> [f32; 6] {
169-
let correct = (self.dpi / 72.0) as f32;
170-
[
171-
self.factor_x as f32 * correct,
172-
0.0,
173-
0.0,
174-
-self.factor_y as f32 * correct,
175-
self.offset_x as f32 * correct,
176-
(self.offset_y + self.height_y) as f32 * correct,
177-
]
178-
}
179-
180141
/// Get the transformation matrix for this converter but without accounting
181142
/// for either DPI or that the PDF coordinate system is flipped. This is
182143
/// useful for converting between two SVG coordinate systems.
@@ -206,18 +167,6 @@ impl CoordToPdf {
206167
)
207168
}
208169

209-
/// Apply a transformation matrix to a point, this is okay for diagonal
210-
/// transformations.
211-
fn apply_x(&self, x: f64) -> f64 {
212-
x * self.matrix[0] + self.matrix[4]
213-
}
214-
215-
/// Apply a transformation matrix to a point, this is okay for diagonal
216-
/// transformations.
217-
fn apply_y(&self, y: f64) -> f64 {
218-
y * self.matrix[3] + self.matrix[5]
219-
}
220-
221170
/// Set a pre-transformation, overriding the old one.
222171
pub fn transform(&mut self, matrix: [f64; 6]) {
223172
self.matrix = matrix

0 commit comments

Comments
 (0)