Changeset 7676 in josm for trunk/src/com/kitfox/svg/Text.java
- Timestamp:
- 2014-10-30T11:39:47+01:00 (11 years ago)
- File:
-
- 1 edited
-
trunk/src/com/kitfox/svg/Text.java (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/kitfox/svg/Text.java
r6002 r7676 42 42 import java.awt.geom.AffineTransform; 43 43 import java.awt.geom.GeneralPath; 44 import java.awt.geom.Point2D; 44 45 import java.awt.geom.Rectangle2D; 45 46 import java.util.Iterator; … … 209 210 } else 210 211 { 211 fontWeight = TXWE_ BOLD;212 fontWeight = TXWE_NORMAL; 212 213 } 213 214 … … 352 353 { 353 354 AffineTransform at = new AffineTransform(); 354 at.translate(-textPath.getBounds 2D().getWidth() / 2, 0);355 at.translate(-textPath.getBounds().getWidth() / 2, 0); 355 356 textPath.transform(at); 356 357 break; … … 359 360 { 360 361 AffineTransform at = new AffineTransform(); 361 at.translate(-textPath.getBounds 2D().getWidth(), 0);362 at.translate(-textPath.getBounds().getWidth(), 0); 362 363 textPath.transform(at); 363 364 break; … … 390 391 if (obj instanceof String) 391 392 { 392 String text = (String) obj; 393 String text = (String)obj; 394 text = text.trim(); 393 395 394 396 Shape textShape = font.createGlyphVector(frc, text).getOutline(cursorX, cursorY); … … 415 417 416 418 417 Tspan tspan = (Tspan) obj; 418 tspan.setCursorX(cursorX); 419 tspan.setCursorY(cursorY); 420 tspan.addShape(textPath); 421 cursorX = tspan.getCursorX(); 422 cursorY = tspan.getCursorY(); 419 Tspan tspan = (Tspan)obj; 420 Point2D cursor = new Point2D.Float(cursorX, cursorY); 421 // tspan.setCursorX(cursorX); 422 // tspan.setCursorY(cursorY); 423 tspan.appendToShape(textPath, cursor); 424 // cursorX = tspan.getCursorX(); 425 // cursorY = tspan.getCursorY(); 426 cursorX = (float)cursor.getX(); 427 cursorY = (float)cursor.getY(); 423 428 424 429 } … … 430 435 { 431 436 AffineTransform at = new AffineTransform(); 432 at.translate(-textPath.getBounds 2D().getWidth() / 2, 0);437 at.translate(-textPath.getBounds().getWidth() / 2, 0); 433 438 textPath.transform(at); 434 439 break; … … 437 442 { 438 443 AffineTransform at = new AffineTransform(); 439 at.translate(-textPath.getBounds 2D().getWidth(), 0);444 at.translate(-Math.ceil(textPath.getBounds().getWidth()), 0); 440 445 textPath.transform(at); 441 446 break;
Note:
See TracChangeset
for help on using the changeset viewer.
