Browse Source

Merge pull request #78 from csmith/master

More highlight tidying.
pull/79/head
Greg Holmes 9 years ago
parent
commit
3d0991f245

+ 6
- 4
ui_swing/src/com/dmdirc/addons/ui_swing/textpane/BasicTextLineRenderer.java View File

@@ -202,19 +202,21 @@ public class BasicTextLineRenderer implements LineRenderer {
202 202
         as.addAttribute(TextAttribute.BACKGROUND, highlightBackground);
203 203
         final TextLayout newLayout = new TextLayout(as.getIterator(), g.getFontRenderContext());
204 204
 
205
-        final Rectangle2D bounds = logicalHighlightShape.getBounds2D();
205
+        final Rectangle2D bounds = logicalHighlightShape.getBounds();
206 206
 
207 207
         g.setColor(highlightBackground);
208
+        g.translate(drawPosX + bounds.getX(), drawPosY);
208 209
 
209 210
         if (isEndOfLine) {
210 211
             g.fill(new Rectangle2D.Double(
211
-                    bounds.getX() + bounds.getWidth(),
212
-                    drawPosY + bounds.getY(),
212
+                    bounds.getWidth(),
213
+                    bounds.getY(),
213 214
                     canvasWidth - bounds.getX() - bounds.getWidth(),
214 215
                     bounds.getHeight()));
215 216
         }
216 217
 
217
-        newLayout.draw(g, (float) (drawPosX + bounds.getX()), drawPosY);
218
+        newLayout.draw(g, 0, 0);
219
+        g.translate(-drawPosX - bounds.getX(), -drawPosY);
218 220
     }
219 221
 
220 222
 }

Loading…
Cancel
Save