OLD | NEW |
1 | 1 |
2 //---------------------------------------------------------------------------- | 2 //---------------------------------------------------------------------------- |
3 // Anti-Grain Geometry - Version 2.3 | 3 // Anti-Grain Geometry - Version 2.3 |
4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) | 4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) |
5 // | 5 // |
6 // Permission to copy, use, modify, sell and distribute this software | 6 // Permission to copy, use, modify, sell and distribute this software |
7 // is granted provided this copyright notice appears in all copies. | 7 // is granted provided this copyright notice appears in all copies. |
8 // This software is provided "as is" without express or implied | 8 // This software is provided "as is" without express or implied |
9 // warranty, and with no claim as to its suitability for any purpose. | 9 // warranty, and with no claim as to its suitability for any purpose. |
10 // | 10 // |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 FX_FLOAT len2, | 191 FX_FLOAT len2, |
192 FX_FLOAT width, | 192 FX_FLOAT width, |
193 line_join_e line_join, | 193 line_join_e line_join, |
194 inner_join_e inner_join, | 194 inner_join_e inner_join, |
195 FX_FLOAT miter_limit, | 195 FX_FLOAT miter_limit, |
196 FX_FLOAT inner_miter_limit, | 196 FX_FLOAT inner_miter_limit, |
197 FX_FLOAT approximation_scale) | 197 FX_FLOAT approximation_scale) |
198 { | 198 { |
199 typedef typename VertexConsumer::value_type coord_type; | 199 typedef typename VertexConsumer::value_type coord_type; |
200 FX_FLOAT dx1, dy1, dx2, dy2; | 200 FX_FLOAT dx1, dy1, dx2, dy2; |
201 dx1 = FXSYS_MulDiv(width, v1.y - v0.y, len1); | 201 dx1 = width * (v1.y - v0.y) / len1; |
202 dy1 = FXSYS_MulDiv(width, v1.x - v0.x, len1); | 202 dy1 = width * (v1.x - v0.x) / len1; |
203 dx2 = FXSYS_MulDiv(width, v2.y - v1.y, len2); | 203 dx2 = width * (v2.y - v1.y) / len2; |
204 dy2 = FXSYS_MulDiv(width, v2.x - v1.x, len2); | 204 dy2 = width * (v2.x - v1.x) / len2; |
205 out_vertices.remove_all(); | 205 out_vertices.remove_all(); |
206 if(calc_point_location(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y) > 0) { | 206 if(calc_point_location(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y) > 0) { |
207 switch(inner_join) { | 207 switch(inner_join) { |
208 default: | 208 default: |
209 out_vertices.add(coord_type(v1.x + dx1, v1.y - dy1)); | 209 out_vertices.add(coord_type(v1.x + dx1, v1.y - dy1)); |
210 out_vertices.add(coord_type(v1.x + dx2, v1.y - dy2)); | 210 out_vertices.add(coord_type(v1.x + dx2, v1.y - dy2)); |
211 break; | 211 break; |
212 case inner_miter: | 212 case inner_miter: |
213 stroke_calc_miter(out_vertices, | 213 stroke_calc_miter(out_vertices, |
214 v0, v1, v2, dx1, dy1, dx2, dy2, | 214 v0, v1, v2, dx1, dy1, dx2, dy2, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 break; | 264 break; |
265 default: | 265 default: |
266 out_vertices.add(coord_type(v1.x + dx1, v1.y - dy1)); | 266 out_vertices.add(coord_type(v1.x + dx1, v1.y - dy1)); |
267 out_vertices.add(coord_type(v1.x + dx2, v1.y - dy2)); | 267 out_vertices.add(coord_type(v1.x + dx2, v1.y - dy2)); |
268 break; | 268 break; |
269 } | 269 } |
270 } | 270 } |
271 } | 271 } |
272 } | 272 } |
273 #endif | 273 #endif |
OLD | NEW |