--------------------------------------------------------------------------
| 431 | |
| 432 | //-------------------------------------------------------------------------- |
| 433 | void GuiMLTextCtrl::onRender(Point2I offset, const RectI& updateRect) |
| 434 | { |
| 435 | Parent::onRender(offset, updateRect); |
| 436 | |
| 437 | GFXDrawUtil *drawer = GFX->getDrawUtil(); |
| 438 | |
| 439 | // draw all the bitmaps |
| 440 | for(BitmapRef *walk = mBitmapRefList; walk; walk = walk->next) |
| 441 | { |
| 442 | RectI screenBounds = *walk; |
| 443 | screenBounds.point += offset; |
| 444 | if(!screenBounds.overlaps(updateRect)) |
| 445 | continue; |
| 446 | |
| 447 | drawer->clearBitmapModulation(); |
| 448 | drawer->drawBitmap(walk->bitmap->bitmapObject, screenBounds.point); |
| 449 | //GFX->drawRectFill(screenBounds, mProfile->mFillColor); |
| 450 | } |
| 451 | |
| 452 | offset += mProfile->mTextOffset; |
| 453 | |
| 454 | // draw all the text and dividerStyles |
| 455 | for(Line *lwalk = mLineList; lwalk; lwalk = lwalk->next) |
| 456 | { |
| 457 | RectI lineRect(offset.x, offset.y + lwalk->y, getWidth(), lwalk->height); |
| 458 | |
| 459 | if(!lineRect.overlaps(updateRect)) |
| 460 | continue; |
| 461 | |
| 462 | if(lwalk->divStyle) |
| 463 | drawer->drawRectFill(lineRect, mProfile->mFillColorHL); |
| 464 | |
| 465 | for(Atom *awalk = lwalk->atomList; awalk; awalk = awalk->next) |
| 466 | { |
| 467 | if(!mSelectionActive || mSelectionEnd < awalk->textStart || mSelectionStart >= awalk->textStart + awalk->len) |
| 468 | drawAtomText(false, awalk->textStart, awalk->textStart + awalk->len, awalk, lwalk, offset); |
| 469 | else |
| 470 | { |
| 471 | U32 selectionStart = getMax(awalk->textStart, mSelectionStart); |
| 472 | U32 selectionEnd = getMin(awalk->textStart + awalk->len, mSelectionEnd + 1); |
| 473 | |
| 474 | // draw some unselected text |
| 475 | if(selectionStart > awalk->textStart) |
| 476 | drawAtomText(false, awalk->textStart, selectionStart, awalk, lwalk, offset); |
| 477 | |
| 478 | // draw the selection |
| 479 | drawAtomText(true, selectionStart, selectionEnd, awalk, lwalk, offset); |
| 480 | |
| 481 | if(selectionEnd < awalk->textStart + awalk->len) |
| 482 | drawAtomText(false, selectionEnd, awalk->textStart + awalk->len, awalk, lwalk, offset); |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | drawer->clearBitmapModulation(); |
| 488 | } |
| 489 | |
| 490 | //-------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected