Changeset 34652 in osm for applications/editors/josm/plugins/seachart/src/render/Renderer.java
- Timestamp:
- 2018-09-15T13:50:24+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r33195 r34652 423 423 if (delta == null) delta = new Delta(Handle.CC); 424 424 if (bg == null) bg = new Color(0x00000000, true); 425 if ( (str == null) || (str.isEmpty())) str = " ";425 if (str == null || str.isEmpty()) str = " "; 426 426 FontRenderContext frc = g2.getFontRenderContext(); 427 GlyphVector gv = font.deriveFont((float) (font.getSize())).createGlyphVector(frc, str.equals(" ") ? "M" : str);427 GlyphVector gv = font.deriveFont((float) font.getSize()).createGlyphVector(frc, str.equals(" ") ? "M" : str); 428 428 Rectangle2D bounds = gv.getVisualBounds(); 429 429 double width = bounds.getWidth(); … … 593 593 pos.translate((mid.getX() - centre.getX()), (mid.getY() - centre.getY())); 594 594 Symbol label = new Symbol(); 595 label.add(new Instr(Form.BBOX, new Rectangle2D.Double((-width / 2), (-height), width, height)));595 label.add(new Instr(Form.BBOX, new Rectangle2D.Double((-width / 2), -height, width, height))); 596 596 label.add(new Instr(Form.TEXT, new Caption(str, font, colour, new Delta(Handle.BC)))); 597 597 Symbols.drawSymbol(g2, label, sScale, centre.getX(), centre.getY(), null, new Delta(Handle.BC, pos)); … … 603 603 public static void lightSector(Color col1, Color col2, double radius, double s1, double s2, Double dir, String str) { 604 604 if ((zoom >= 16) && (radius > 0.2)) { 605 radius /= (Math.pow(2, zoom-15));605 radius /= Math.pow(2, zoom-15); 606 606 } 607 607 double mid = (((s1 + s2) / 2) + (s1 > s2 ? 180 : 0)) % 360; … … 632 632 2 * (radial - arcWidth), -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN)); 633 633 } 634 if ( (str != null) && (!str.isEmpty())) {634 if (str != null && !str.isEmpty()) { 635 635 Font font = new Font("Arial", Font.PLAIN, 40); 636 636 double arc = (s2 > s1) ? (s2 - s1) : (s2 - s1 + 360);
Note:
See TracChangeset
for help on using the changeset viewer.