foreach ( Atom atom, atomList )
  {
    if ( atom.column > column )
    {
      // Switch to next column
      if ( mEqualColumnWidth )
      {
        point.rx() += mColumnSpace + maxColumnWidth;
      }
      else
      {
        point.rx() += mColumnSpace + columnWidth;
      }
      point.ry() = columnTop;
      columnWidth = 0;
      column++;
      firstInColumn = true;
    }
    // Add space if necessary, unfortunately it depends on first nucleon
    if ( !firstInColumn )
    {
      point.ry() += spaceAboveAtom( atom );
    }

    drawAtom( atom, painter, point );
    columnWidth = qMax( atom.size.width(), columnWidth );

    point.ry() += atom.size.height();
    columnMaxHeight = qMax( point.y() - columnTop, columnMaxHeight );

    firstInColumn = false;
  }
Beispiel #2
0
  foreach ( Atom atom, atomList )
  {
    if ( atom.column > column )
    {
      // Switch to next column
      if ( mEqualColumnWidth )
      {
        point.rx() += mColumnSpace + maxColumnWidth;
      }
      else
      {
        point.rx() += mColumnSpace + columnWidth;
      }
      point.ry() = columnTop;
      columnWidth = 0;
      column++;
      firstInColumn = true;
    }
    if ( !firstInColumn )
    {
      point.ry() += spaceAboveAtom( atom );
    }

    QSizeF atomSize = drawAtom( atom, painter, point );
    columnWidth = qMax( atomSize.width(), columnWidth );

    point.ry() += atom.size.height();
    columnMaxHeight = qMax( point.y() - columnTop, columnMaxHeight );

    firstInColumn = false;
  }