comparison dwtx/jface/text/CursorLinePainter.d @ 162:1a5b8f8129df

...
author Frank Benoit <benoit@tionex.de>
date Mon, 08 Sep 2008 00:51:37 +0200
parents eb21d3dfc767
children
comparison
equal deleted inserted replaced
161:f8d52b926852 162:1a5b8f8129df
185 private Color fHighlightColor; 185 private Color fHighlightColor;
186 /** The paint position manager for managing the line coordinates */ 186 /** The paint position manager for managing the line coordinates */
187 private IPaintPositionManager fPositionManager; 187 private IPaintPositionManager fPositionManager;
188 188
189 /** Keeps track of the line to be painted */ 189 /** Keeps track of the line to be painted */
190 private Position fCurrentLine= new Position(0, 0); 190 private Position fCurrentLine;
191 /** Keeps track of the line to be cleared */ 191 /** Keeps track of the line to be cleared */
192 private Position fLastLine= new Position(0, 0); 192 private Position fLastLine;
193 /** Keeps track of the line number of the last painted line */ 193 /** Keeps track of the line number of the last painted line */
194 private int fLastLineNumber= -1; 194 private int fLastLineNumber= -1;
195 /** Indicates whether this painter is active */ 195 /** Indicates whether this painter is active */
196 private bool fIsActive; 196 private bool fIsActive;
197 197
199 * Creates a new painter for the given source viewer. 199 * Creates a new painter for the given source viewer.
200 * 200 *
201 * @param textViewer the source viewer for which to create a painter 201 * @param textViewer the source viewer for which to create a painter
202 */ 202 */
203 public this(ITextViewer textViewer) { 203 public this(ITextViewer textViewer) {
204 fCurrentLine= new Position(0, 0);
205 fLastLine= new Position(0, 0);
204 fViewer= textViewer; 206 fViewer= textViewer;
205 } 207 }
206 208
207 /** 209 /**
208 * Sets the color in which to draw the background of the cursor line. 210 * Sets the color in which to draw the background of the cursor line.
249 // initially fLastLineNumber is -1 251 // initially fLastLineNumber is -1
250 if (lineNumber !is fLastLineNumber || !fCurrentLine.overlapsWith(modelCaret, 0)) { 252 if (lineNumber !is fLastLineNumber || !fCurrentLine.overlapsWith(modelCaret, 0)) {
251 253
252 fLastLine.offset= fCurrentLine.offset; 254 fLastLine.offset= fCurrentLine.offset;
253 fLastLine.length= fCurrentLine.length; 255 fLastLine.length= fCurrentLine.length;
254 fLastLine.isDeleted= fCurrentLine.isDeleted; 256 fLastLine.isDeleted_= fCurrentLine.isDeleted_;
255 257
256 if (fCurrentLine.isDeleted) { 258 if (fCurrentLine.isDeleted_) {
257 fCurrentLine.isDeleted= false; 259 fCurrentLine.isDeleted_= false;
258 fPositionManager.managePosition(fCurrentLine); 260 fPositionManager.managePosition(fCurrentLine);
259 } 261 }
260 262
261 fCurrentLine.offset= document.getLineOffset(lineNumber); 263 fCurrentLine.offset= document.getLineOffset(lineNumber);
262 if (lineNumber is document.getNumberOfLines() - 1) 264 if (lineNumber is document.getNumberOfLines() - 1)