OLD | NEW |
1 | 1 |
2 //---------------------------------------------------------------------------- | 2 //---------------------------------------------------------------------------- |
3 // XYQ: 2006-01-22 Copied from AGG project. | 3 // XYQ: 2006-01-22 Copied from AGG project. |
4 // TODO: This file uses intensive floating point operations, so it's NOT suitabl
e | 4 // TODO: This file uses intensive floating point operations, so it's NOT suitabl
e |
5 // for platforms like Symbian OS. We need to change to FIX format. | 5 // for platforms like Symbian OS. We need to change to FIX format. |
6 //---------------------------------------------------------------------------- | 6 //---------------------------------------------------------------------------- |
7 //---------------------------------------------------------------------------- | 7 //---------------------------------------------------------------------------- |
8 // Anti-Grain Geometry - Version 2.3 | 8 // Anti-Grain Geometry - Version 2.3 |
9 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) | 9 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) |
10 // | 10 // |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 m_src_vertices.add(vertex_dist_cmd(x, y, cmd)); | 61 m_src_vertices.add(vertex_dist_cmd(x, y, cmd)); |
62 } else { | 62 } else { |
63 m_closed = get_close_flag(cmd); | 63 m_closed = get_close_flag(cmd); |
64 } | 64 } |
65 } | 65 } |
66 } | 66 } |
67 static inline void calc_butt_cap(FX_FLOAT* cap, | 67 static inline void calc_butt_cap(FX_FLOAT* cap, |
68 const vertex_dist& v0, | 68 const vertex_dist& v0, |
69 const vertex_dist& v1, | 69 const vertex_dist& v1, |
70 FX_FLOAT len, | 70 FX_FLOAT len, |
71 FX_FLOAT width) | 71 FX_FLOAT width) { |
72 { | 72 FX_FLOAT dx = (v1.y - v0.y) * width / len; |
73 FX_FLOAT dx = FXSYS_MulDiv(v1.y - v0.y, width, len); | 73 FX_FLOAT dy = (v1.x - v0.x) * width / len; |
74 FX_FLOAT dy = FXSYS_MulDiv(v1.x - v0.x, width, len); | 74 cap[0] = v0.x - dx; |
75 cap[0] = v0.x - dx; | 75 cap[1] = v0.y + dy; |
76 cap[1] = v0.y + dy; | 76 cap[2] = v0.x + dx; |
77 cap[2] = v0.x + dx; | 77 cap[3] = v0.y - dy; |
78 cap[3] = v0.y - dy; | |
79 } | 78 } |
80 void vcgen_stroke::rewind(unsigned) | 79 void vcgen_stroke::rewind(unsigned) |
81 { | 80 { |
82 if(m_status == initial) { | 81 if(m_status == initial) { |
83 m_src_vertices.close(m_closed != 0); | 82 m_src_vertices.close(m_closed != 0); |
84 if(m_src_vertices.size() < 3) { | 83 if(m_src_vertices.size() < 3) { |
85 m_closed = 0; | 84 m_closed = 0; |
86 } | 85 } |
87 } | 86 } |
88 m_status = ready; | 87 m_status = ready; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 m_status = m_prev_status; | 206 m_status = m_prev_status; |
208 return path_cmd_end_poly | path_flags_close | path_flags_cw; | 207 return path_cmd_end_poly | path_flags_close | path_flags_cw; |
209 case stop: | 208 case stop: |
210 cmd = path_cmd_stop; | 209 cmd = path_cmd_stop; |
211 break; | 210 break; |
212 } | 211 } |
213 } | 212 } |
214 return cmd; | 213 return cmd; |
215 } | 214 } |
216 } | 215 } |
OLD | NEW |