Ignore:
Timestamp:
2009-07-18T18:11:16+02:00 (15 years ago)
Author:
hampelratte
Message:

improved size calculation of the bug description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java

    r16294 r16564  
    162162                    }
    163163
    164                     // FIXME hiehgt calculations doesn't work with all LAFs
    165                     int lineCount = lines.length;
    166                     int HR_SIZE = 10;
    167                     int tooltipHeight = lineCount * (int)fontBounds.getHeight() + HR_SIZE * (lineCount - 1);
    168 
    169164                    // draw description as a tooltip
    170165                    tooltip.setTipText(desc);
    171                     tooltip.setSize(tooltipWidth+10, tooltipHeight + 6);
    172 
     166                    tooltip.setSize(tooltip.getUI().getPreferredSize(tooltip));
     167                   
    173168                    int tx = p.x + (width / 2) + 5;
    174                     int ty = (int)(p.y - height / 2);
     169                    int ty = (int)(p.y - height / 2) -1;
    175170                    g.translate(tx, ty);
    176171                    tooltip.paint(g);
Note: See TracChangeset for help on using the changeset viewer.