src/gui/painting/qpainter.cpp
changeset 25 e24348a560a6
parent 18 2f34d5167611
child 29 b72c6db6890b
equal deleted inserted replaced
23:89e065397ea6 25:e24348a560a6
  5771         QFont f = engine.font(si);
  5771         QFont f = engine.font(si);
  5772         QTextItemInt gf(si, &f);
  5772         QTextItemInt gf(si, &f);
  5773         gf.glyphs = engine.shapedGlyphs(&si);
  5773         gf.glyphs = engine.shapedGlyphs(&si);
  5774         gf.chars = engine.layoutData->string.unicode() + si.position;
  5774         gf.chars = engine.layoutData->string.unicode() + si.position;
  5775         gf.num_chars = engine.length(item);
  5775         gf.num_chars = engine.length(item);
  5776         gf.width = si.width;
  5776         if (engine.forceJustification) {
       
  5777             for (int j=0; j<gf.glyphs.numGlyphs; ++j)
       
  5778                 gf.width += gf.glyphs.effectiveAdvance(j);
       
  5779         } else {
       
  5780             gf.width = si.width;
       
  5781         }
  5777         gf.logClusters = engine.logClusters(&si);
  5782         gf.logClusters = engine.logClusters(&si);
  5778 
  5783 
  5779         drawTextItem(QPointF(x.toReal(), p.y()), gf);
  5784         drawTextItem(QPointF(x.toReal(), p.y()), gf);
  5780 
  5785 
  5781         x += si.width;
  5786         x += gf.width;
  5782     }
  5787     }
  5783 }
  5788 }
  5784 
  5789 
  5785 void QPainter::drawText(const QRect &r, int flags, const QString &str, QRect *br)
  5790 void QPainter::drawText(const QRect &r, int flags, const QString &str, QRect *br)
  5786 {
  5791 {