~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/widgets/scrollarea.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-07-11 10:09:41 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130711100941-f0rwuvcwgl8ulqo8
Tags: 1.3.7.7.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    mY(0),
56
56
    mClickX(0),
57
57
    mClickY(0),
58
 
    mHasMouse(false),
59
 
    mOpaque(opaque),
60
58
    mVertexes(new ImageCollection),
61
59
    mVertexes2(new ImageCollection),
62
 
    mRedraw(true),
63
60
    mXOffset(0),
64
61
    mYOffset(0),
65
62
    mDrawWidth(0),
66
 
    mDrawHeight(0)
 
63
    mDrawHeight(0),
 
64
    mHasMouse(false),
 
65
    mOpaque(opaque),
 
66
    mRedraw(true)
67
67
{
68
68
    addWidgetListener(this);
69
69
    init(skin);
77
77
    mY(0),
78
78
    mClickX(0),
79
79
    mClickY(0),
80
 
    mHasMouse(false),
81
 
    mOpaque(opaque),
82
80
    mVertexes(new ImageCollection),
83
81
    mVertexes2(new ImageCollection),
84
 
    mRedraw(true),
85
82
    mXOffset(0),
86
83
    mYOffset(0),
87
84
    mDrawWidth(0),
88
 
    mDrawHeight(0)
 
85
    mDrawHeight(0),
 
86
    mHasMouse(false),
 
87
    mOpaque(opaque),
 
88
    mRedraw(true)
89
89
{
90
90
    init(skin);
91
91
}
356
356
    BLOCK_START("ScrollArea::drawFrame")
357
357
    if (mOpaque)
358
358
    {
359
 
        const int bs = mFrameSize;
360
 
        const int w = mDimension.width + bs * 2;
361
 
        const int h = mDimension.height + bs * 2;
 
359
        const int bs = mFrameSize * 2;
 
360
        const int w = mDimension.width + bs;
 
361
        const int h = mDimension.height + bs;
362
362
 
363
363
        updateCalcFlag(graphics);
364
364
 
671
671
    }
672
672
    else if (getLeftButtonDimension().isPointInRect(x, y))
673
673
    {
674
 
        setHorizontalScrollAmount(getHorizontalScrollAmount()
 
674
        setHorizontalScrollAmount(mHScroll
675
675
                                  - mLeftButtonScrollAmount);
676
676
        mLeftButtonPressed = true;
677
677
    }
678
678
    else if (getRightButtonDimension().isPointInRect(x, y))
679
679
    {
680
 
        setHorizontalScrollAmount(getHorizontalScrollAmount()
 
680
        setHorizontalScrollAmount(mHScroll
681
681
                                  + mRightButtonScrollAmount);
682
682
        mRightButtonPressed = true;
683
683
    }
712
712
    {
713
713
        if (x < getHorizontalMarkerDimension().x)
714
714
        {
715
 
            setHorizontalScrollAmount(getHorizontalScrollAmount()
 
715
            setHorizontalScrollAmount(mHScroll
716
716
                - static_cast<int>(getChildrenArea().width * 0.95));
717
717
        }
718
718
        else
719
719
        {
720
 
            setHorizontalScrollAmount(getHorizontalScrollAmount()
 
720
            setHorizontalScrollAmount(mHScroll
721
721
                + static_cast<int>(getChildrenArea().width * 0.95));
722
722
        }
723
723
    }
952
952
    const int maxH = getHorizontalMaxScroll();
953
953
    if (mMarkerSize && maxH)
954
954
    {
955
 
        pos = (getHorizontalScrollAmount() * width / maxH - mMarkerSize / 2);
 
955
        pos = (mHScroll * width / maxH - mMarkerSize / 2);
956
956
        length = mMarkerSize;
957
957
    }
958
958
    else
978
978
 
979
979
        if (getHorizontalMaxScroll() != 0)
980
980
        {
981
 
            pos = ((width - length) * getHorizontalScrollAmount())
 
981
            pos = ((width - length) * mHScroll)
982
982
                / getHorizontalMaxScroll();
983
983
        }
984
984
        else