Revision 31296 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/TextPath.java
TextPath.java | ||
---|---|---|
170 | 170 |
|
171 | 171 |
PathLength pl = new PathLength(shape); |
172 | 172 |
|
173 |
float midDistance = pl.lengthOfPath() / 2; |
|
174 |
Point2D pAux = pl.pointAtLength(midDistance); |
|
175 |
double angle = pl.angleAtLength(midDistance); |
|
176 |
|
|
177 |
boolean bFlip = false; |
|
178 |
if (angle < 0) { |
|
179 |
angle = angle + (float) (2 * Math.PI); |
|
180 |
// bFlip = true; |
|
181 |
} |
|
182 |
|
|
183 |
if ((angle > (Math.PI / 2)) && |
|
184 |
(angle < ((3 * Math.PI) / 2))) { |
|
185 |
angle = angle - (float) Math.PI; |
|
186 |
bFlip = true; |
|
187 |
} |
|
188 |
|
|
173 | 189 |
GeneralPathX correctedPath = new GeneralPathX(); |
174 | 190 |
int controlPoints = 16; |
175 | 191 |
double[][] points = new double[controlPoints][2]; |
... | ... | |
253 | 269 |
} |
254 | 270 |
} |
255 | 271 |
correctedPath.lineTo(endPointX, endPointY); |
272 |
if (bFlip) |
|
273 |
correctedPath.flip(); |
|
256 | 274 |
|
257 | 275 |
return new FShapeGeneralPathX(correctedPath, shape.getShapeType()); |
258 | 276 |
} |
Also available in: Unified diff