Преглед на файлове

Merge pull request #78 from csmith/master

More highlight tidying.
pull/79/head
Greg Holmes преди 9 години
родител
ревизия
3d0991f245
променени са 1 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. 6
    4
      ui_swing/src/com/dmdirc/addons/ui_swing/textpane/BasicTextLineRenderer.java

+ 6
- 4
ui_swing/src/com/dmdirc/addons/ui_swing/textpane/BasicTextLineRenderer.java Целия файл

202
         as.addAttribute(TextAttribute.BACKGROUND, highlightBackground);
202
         as.addAttribute(TextAttribute.BACKGROUND, highlightBackground);
203
         final TextLayout newLayout = new TextLayout(as.getIterator(), g.getFontRenderContext());
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
         g.setColor(highlightBackground);
207
         g.setColor(highlightBackground);
208
+        g.translate(drawPosX + bounds.getX(), drawPosY);
208
 
209
 
209
         if (isEndOfLine) {
210
         if (isEndOfLine) {
210
             g.fill(new Rectangle2D.Double(
211
             g.fill(new Rectangle2D.Double(
211
-                    bounds.getX() + bounds.getWidth(),
212
-                    drawPosY + bounds.getY(),
212
+                    bounds.getWidth(),
213
+                    bounds.getY(),
213
                     canvasWidth - bounds.getX() - bounds.getWidth(),
214
                     canvasWidth - bounds.getX() - bounds.getWidth(),
214
                     bounds.getHeight()));
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…
Отказ
Запис