~canonical-dx-team/nux/nux.fix-702538

« back to all changes in this revision

Viewing changes to Nux/TextView/TextViewScroll.cpp

  • Committer: Jay Taoko
  • Date: 2011-01-04 03:57:29 UTC
  • mfrom: (157.1.13 nux-holidays)
  • Revision ID: jay.taoko@canonical.com-20110104035729-0xh3iabo7e7dk371
* Added support to copy a texture from the current render target
* Blur, Color matrix, Exponent shaders
* Gaussian blur
* Bug fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
  {
157
157
    int margin = LeftMarginWidth();
158
158
 
159
 
    m_nWindowLines   = std::min<int> ( (unsigned) height                / m_nLineHeight, m_nLineCount);
160
 
    m_nWindowColumns = std::min<int> ( (width - margin)         / m_nFontWidth,  m_nLongestLine);
 
159
    m_nWindowLines   = Min<int> ( (unsigned) height             / m_nLineHeight, m_nLineCount);
 
160
    m_nWindowColumns = Min<int> ( (width - margin)              / m_nFontWidth,  m_nLongestLine);
161
161
 
162
162
    if (PinToBottomCorner() )
163
163
    {
192
192
    // scroll up
193
193
    if (dy < 0)
194
194
    {
195
 
      dy = - (int) std::min (-dy, m_nVScrollPos);
 
195
      dy = - (int) Min<int> (-dy, m_nVScrollPos);
196
196
      clip.top = -dy * m_nLineHeight;
197
197
    }
198
198
    // scroll down
199
199
    else if (dy > 0)
200
200
    {
201
 
      dy = std::min (dy, m_nVScrollMax - m_nVScrollPos);
 
201
      dy = Min<int> (dy, m_nVScrollMax - m_nVScrollPos);
202
202
      clip.bottom = (m_nWindowLines - dy) * m_nLineHeight;
203
203
    }
204
204
 
206
206
    // scroll left
207
207
    if (dx < 0)
208
208
    {
209
 
      dx = - (int) std::min (-dx, m_nHScrollPos);
 
209
      dx = - (int) Min<int> (-dx, m_nHScrollPos);
210
210
      clip.left = -dx * m_nFontWidth * 4;
211
211
    }
212
212
    // scroll right
213
213
    else if (dx > 0)
214
214
    {
215
 
      dx = std::min (dx, m_nHScrollMax - m_nHScrollPos);
 
215
      dx = Min<int> (dx, m_nHScrollMax - m_nHScrollPos);
216
216
      clip.right = (m_nWindowColumns - dx - 4) * m_nFontWidth ;
217
217
    }
218
218