int y = visibleLineToY(visibleStartLine) + getAscent() + 1;
g.setColor(attributes.getEffectColor());
if (attributes.getEffectType() == EffectType.WAVE_UNDERSCORE) {
- UIUtil.drawWave((Graphics2D)g, new Rectangle(end.x, y, charWidth - 1, 2));
+ UIUtil.drawWave((Graphics2D)g, new Rectangle(end.x, y, charWidth - 1, getDescent()- 1));
}
else if (attributes.getEffectType() == EffectType.BOLD_DOTTED_LINE) {
final int dottedAt = SystemInfo.isMac ? y - 1 : y;
GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
Stroke oldStroke = g.getStroke();
try {
- g.setStroke(new BasicStroke(0.7F));
- double cycle = 4;
- final double wavedAt = rectangle.y + (double)rectangle.height /2 - .5;
+ float thickness = 0.7f;
+ g.setStroke(new BasicStroke(thickness));
+ double height = 1;
+ double cycle = 4*height;
+ final double wavedAt = rectangle.y + rectangle.height - thickness - height;
GeneralPath wavePath = new GeneralPath();
- wavePath.moveTo(rectangle.x, wavedAt - Math.cos(rectangle.x * 2 * Math.PI / cycle));
- for (int x = rectangle.x + 1; x <= rectangle.x + rectangle.width; x++) {
- wavePath.lineTo(x, wavedAt - Math.cos(x * 2 * Math.PI / cycle) );
+ wavePath.moveTo(rectangle.x, wavedAt - Math.cos(rectangle.x * 2 * Math.PI / cycle)*height);
+ for (int x = rectangle.x + 1; x < rectangle.x + rectangle.width; x++) {
+ wavePath.lineTo(x, wavedAt - Math.cos(x * 2 * Math.PI / cycle)*height);
}
g.draw(wavePath);
}