//----------------------------------------------------------------- void View::drawOn(SDL_Surface *screen) { m_screen = screen; m_animShift = min(SCALE, m_animShift + m_shiftSize); m_models.drawOn(this); drawDecors(); }
void fp_AnnotationRun::_draw(dg_DrawArgs* pDA) { if(!displayAnnotations()) return; if(!m_bIsStart) return; GR_Graphics * pG = pDA->pG; UT_sint32 xoff = 0, yoff = 0; GR_Painter painter(pG); // need screen locations of this run getLine()->getScreenOffsets(this, xoff, yoff); UT_sint32 iYdraw = pDA->yoff - getAscent()-1; UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset(); // // Sevior was here // UT_sint32 iFillTop = iYdraw; UT_sint32 iFillTop = iYdraw+1; UT_sint32 iFillHeight = getAscent() + getDescent(); FV_View* pView = _getView(); UT_uint32 iSelAnchor = pView->getSelectionAnchor(); UT_uint32 iPoint = pView->getPoint(); UT_uint32 iSel1 = UT_MIN(iSelAnchor, iPoint); UT_uint32 iSel2 = UT_MAX(iSelAnchor, iPoint); UT_ASSERT(iSel1 <= iSel2); bool bIsInTOC = getBlock()->isContainedByTOC(); if ( isInSelectedTOC() || (!bIsInTOC && ( /* pView->getFocus()!=AV_FOCUS_NONE && */ (iSel1 <= iRunBase) && (iSel2 > iRunBase))) ) { UT_RGBColor color(_getView()->getColorSelBackground()); pG->setColor(_getView()->getColorAnnotation(this)); painter.fillRect(color, pDA->xoff, iFillTop, getWidth(), iFillHeight); } else { Fill(getGraphics(),pDA->xoff, iFillTop, getWidth(), iFillHeight); pG->setColor(_getColorFG()); } pG->setFont(_getFont()); pG->setColor(_getView()->getColorAnnotation(this)); UT_DEBUGMSG(("Drawing string m_sValue %s \n",m_sValue.utf8_str())); painter.drawChars(m_sValue.ucs4_str().ucs4_str(), 0,m_sValue.ucs4_str().size(), pDA->xoff,iYdraw, NULL); // // Draw underline/overline/strikethough // UT_sint32 yTopOfRun = pDA->yoff - getAscent()-1; // Hack to remove //character dirt drawDecors( xoff, yTopOfRun,pG); }