@@ -1593,31 +1593,31 @@ void createCaretBitmaps() {
1593
1593
leftCaretBitmap .dispose ();
1594
1594
}
1595
1595
int lineHeight = renderer .getLineHeight ();
1596
- leftCaretBitmap = new Image ( display , caretWidth , lineHeight );
1597
- GC gc = new GC ( leftCaretBitmap );
1598
- gc .setBackground ( display . getSystemColor ( SWT . COLOR_BLACK ) );
1599
- gc .fillRectangle ( 0 , 0 , caretWidth , lineHeight );
1600
- gc .setForeground ( display . getSystemColor ( SWT . COLOR_WHITE ) );
1601
- gc .drawLine (0 ,0 ,0 , lineHeight );
1602
- gc .drawLine (0 ,0 , caretWidth - 1 , 0 );
1603
- gc . drawLine ( 0 , 1 , 1 , 1 ) ;
1604
- gc . dispose ( );
1596
+ final ImageGcDrawer imageGcDrawer = ( gc , width , height ) -> {
1597
+ gc . setBackground ( display . getSystemColor ( SWT . COLOR_BLACK ) );
1598
+ gc .fillRectangle ( 0 , 0 , width , height );
1599
+ gc .setForeground ( display . getSystemColor ( SWT . COLOR_WHITE ) );
1600
+ gc .drawLine ( 0 , 0 , 0 , height );
1601
+ gc .drawLine (0 ,0 ,width - 1 , 0 );
1602
+ gc .drawLine (0 ,1 , 1 , 1 );
1603
+ } ;
1604
+ leftCaretBitmap = new Image ( display , imageGcDrawer , caretWidth , lineHeight );
1605
1605
1606
1606
if (rightCaretBitmap != null ) {
1607
1607
if (defaultCaret != null && rightCaretBitmap .equals (defaultCaret .getImage ())) {
1608
1608
defaultCaret .setImage (null );
1609
1609
}
1610
1610
rightCaretBitmap .dispose ();
1611
1611
}
1612
- rightCaretBitmap = new Image ( display , caretWidth , lineHeight );
1613
- gc = new GC ( rightCaretBitmap );
1614
- gc .setBackground ( display . getSystemColor ( SWT . COLOR_BLACK ) );
1615
- gc .fillRectangle ( 0 , 0 , caretWidth , lineHeight );
1616
- gc .setForeground ( display . getSystemColor ( SWT . COLOR_WHITE ) );
1617
- gc .drawLine (caretWidth - 1 ,0 ,caretWidth -1 ,lineHeight );
1618
- gc .drawLine (0 , 0 , caretWidth - 1 , 0 );
1619
- gc . drawLine ( caretWidth - 1 , 1 , 1 , 1 ) ;
1620
- gc . dispose ( );
1612
+ final ImageGcDrawer imageGcDrawer1 = ( gc , width , height ) -> {
1613
+ gc . setBackground ( display . getSystemColor ( SWT . COLOR_BLACK ) );
1614
+ gc .fillRectangle ( 0 , 0 , width , height );
1615
+ gc .setForeground ( display . getSystemColor ( SWT . COLOR_WHITE ) );
1616
+ gc .drawLine ( width - 1 , 0 , width - 1 , height );
1617
+ gc .drawLine (0 ,0 ,width -1 ,0 );
1618
+ gc .drawLine (width - 1 , 1 , 1 , 1 );
1619
+ } ;
1620
+ rightCaretBitmap = new Image ( display , imageGcDrawer1 , caretWidth , lineHeight );
1621
1621
}
1622
1622
/**
1623
1623
* Moves the selected text to the clipboard. The text will be put in the
0 commit comments