~ubuntu-branches/debian/sid/kxstitch/sid

« back to all changes in this revision

Viewing changes to kxstitch/patterncanvas.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mike O'Connor
  • Date: 2009-03-15 09:07:18 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090315090718-w1f0d0ho6d2j9a9v
Tags: 0.8.3.1-1
* New Upstream Version
* Chnage build-dep to work with new libmagick++-dev (Closes: 485893)

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
    int y2 = 0;
144
144
    for (Knot *k = m_pKnot->first() ; k ; k = m_pKnot->next())
145
145
    {
146
 
      x1 = x1 <? k->pos.x();
147
 
      y1 = y1 <? k->pos.y();
148
 
      x2 = x2 >? k->pos.x();
149
 
      y2 = y2 >? k->pos.y();
 
146
      x1 = std::min(x1, k->pos.x());
 
147
      y1 = std::min(y1, k->pos.y());
 
148
      x2 = std::max(x2, k->pos.x());
 
149
      y2 = std::max(y2, k->pos.y());
150
150
    }
151
151
    stitchesRect|=QRect(x1/2,y1/2,(x2-x1)/2,(y2-y1)/2);
152
152
  }
159
159
      QPoint s = bs->start;
160
160
      QPoint e = bs->end;
161
161
      int x1,y1,x2,y2;
162
 
      x1 = s.x() <? e.x();
163
 
      x2 = s.x() >? e.x();
164
 
      y1 = s.y() <? e.y();
165
 
      y2 = s.y() >? e.y();
 
162
      x1 = std::min(s.x(), e.x());
 
163
      x2 = std::max(s.x(), e.x());
 
164
      y1 = std::min(s.y(), e.y());
 
165
      y2 = std::max(s.y(), e.y());
166
166
      if (x1 == x2 || y1 == y2)
167
167
      {
168
168
        // special case as a QRect would show as zero m_width or m_height (ie invalid)
741
741
  int         fileSize = device->size();
742
742
  switch (fileFormatVersion)
743
743
  {
 
744
    case 6:
744
745
    case 5:
745
746
    case 4:
746
747
      if (device->at()+8 > fileSize) return false;