~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/gui/EditableWidget.cxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-06-02 07:33:16 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120602073316-20r4hr32t4oj36u9
Tags: 3.7-1
* New upstream version.
* Update description and documentation with new features in 3.7, notably
  Blargg TV filters (replacing the filters available in versions 3.4.1
  and earlier).
* Switch to debhelper compatibility level 9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
//
17
 
// $Id: EditableWidget.cxx 2417 2012-03-16 13:19:29Z stephena $
 
17
// $Id: EditableWidget.cxx 2438 2012-04-11 16:10:24Z stephena $
18
18
//
19
19
//   Based on code from ScummVM - Scumm Interpreter
20
20
//   Copyright (C) 2002-2004 The ScummVM project
58
58
  _editString = str;
59
59
  _caretPos = _editString.size();
60
60
 
61
 
  _editScrollOffset = (_font->getStringWidth(_editString) - (getEditRect().width()));
 
61
  _editScrollOffset = (_font.getStringWidth(_editString) - (getEditRect().width()));
62
62
  if (_editScrollOffset < 0)
63
63
    _editScrollOffset = 0;
64
64
 
177
177
{
178
178
  int caretpos = 0;
179
179
  for (int i = 0; i < _caretPos; i++)
180
 
    caretpos += _font->getCharWidth(_editString[i]);
 
180
    caretpos += _font.getCharWidth(_editString[i]);
181
181
 
182
182
  caretpos -= _editScrollOffset;
183
183
 
238
238
  }
239
239
  else if (_editScrollOffset > 0)
240
240
  {
241
 
    const int strWidth = _font->getStringWidth(_editString);
 
241
    const int strWidth = _font.getStringWidth(_editString);
242
242
    if (strWidth - _editScrollOffset < editWidth)
243
243
    {
244
244
      // scroll right