Changeset 32082 in osm for applications/editors/josm/plugins/seachart/src/render/Renderer.java
- Timestamp:
- 2016-02-27T09:09:45+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r31532 r32082 47 47 g2.clip(new Rectangle2D.Double(tl.getX(), tl.getY(), (br.getX() - tl.getX()), (br.getY() - tl.getY()))); 48 48 } 49 g2.setBackground(context.background()); 49 g2.setBackground(context.background(map)); 50 50 g2.clearRect(rect.x, rect.y, rect.width, rect.height); 51 51 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); … … 484 484 g2.setPaint(colour); 485 485 FontRenderContext frc = g2.getFontRenderContext(); 486 GlyphVector gv = font.deriveFont( (float)(font.getSize()*sScale)).createGlyphVector(frc, (" " + str));486 GlyphVector gv = font.deriveFont(font.getSize2D() * (float)sScale).createGlyphVector(frc, (" " + str)); 487 487 GeneralPath path = new GeneralPath(); 488 488 Point2D prev = new Point2D.Double(); … … 560 560 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(mid)), centre.y + radial * Math.cos(Math.toRadians(mid)))); 561 561 } else { 562 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s1)), centre.y + radial * Math.cos(Math.toRadians(s1)))); 563 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s2)), centre.y + radial * Math.cos(Math.toRadians(s2)))); 562 if ((s1 != 0.0) || (s2 != 360.0)) { 563 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s1)), centre.y + radial * Math.cos(Math.toRadians(s1)))); 564 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s2)), centre.y + radial * Math.cos(Math.toRadians(s2)))); 565 } 564 566 } 565 567 double arcWidth = 10.0 * sScale; 566 568 g2.setStroke(new BasicStroke((float)arcWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1)); 567 569 g2.setPaint(col1); 568 g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), (s1 - s2 - 360) % 360, Arc2D.OPEN));570 g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), (s1 - s2), Arc2D.OPEN)); 569 571 if (col2 != null) { 570 572 g2.setPaint(col2); 571 g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 2 * (radial - arcWidth), -(s1 + 90), (s1 - s2 - 360) % 360, Arc2D.OPEN));573 g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 2 * (radial - arcWidth), -(s1 + 90), (s1 - s2), Arc2D.OPEN)); 572 574 } 573 575 if ((str != null) && (!str.isEmpty())) { … … 577 579 Font font = new Font("Arial", Font.PLAIN, 40); 578 580 GeneralPath path = new GeneralPath(); 579 GlyphVector gv = font.deriveFont( (float)(font.getSize()*sScale)).createGlyphVector(frc, (" " + str));581 GlyphVector gv = font.deriveFont(font.getSize2D() * (float)sScale).createGlyphVector(frc, (" " + str)); 580 582 double gwidth = gv.getLogicalBounds().getWidth(); 581 583 boolean hand = false; 582 584 double offset = 0; 583 585 Point2D origin; 584 double arc = (s2 - s1 + 360) % 360;586 double arc = (s2 - s1); 585 587 if (dir) { 586 588 radial += 10 * sScale;
Note:
See TracChangeset
for help on using the changeset viewer.