Ignore:
Timestamp:
02/16/13 09:52:01 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
Message:

Made the moving and resizing better looking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/plugin/src/xplra/MessageWindow.cc

    r48 r49  
    7878    showForced(false),
    7979    hideTime(0.0),
     80    clickedX(-1),
     81    clickedY(-1),
     82    clickedLeft(-1),
     83    clickedTop(-1),
     84    clickedRight(-1),
     85    clickedBottom(-1),
    8086    duration(0.0)
    8187{
     
    172178        clickedX = x;
    173179        clickedY = y;
     180        clickedLeft = left;
     181        clickedTop = top;
     182        clickedRight = right;
     183        clickedBottom = bottom;
    174184    } else if (mouse==xplm_MouseDrag) {
    175185        int xDiff = x - clickedX;
    176186
    177187        if (mouseMode==MOUSE_MOVE) {
    178             int newLeft = left + xDiff;
    179             int newRight = right + xDiff;
     188            int newLeft = clickedLeft + xDiff;
     189            int newRight = clickedRight + xDiff;
    180190
    181191            int screenWidth = XPLMGetDatai(widthDataRef);
     
    186196
    187197            int yDiff = y - clickedY;
    188             int newTop = top + yDiff;
    189             int newBottom = bottom + yDiff;
     198            int newTop = clickedTop + yDiff;
     199            int newBottom = clickedBottom + yDiff;
    190200
    191201            int screenHeight = XPLMGetDatai(heightDataRef);
     
    195205            }
    196206        } else if (mouseMode==MOUSE_RESIZE_LEFT) {
    197             int newLeft = left + xDiff;
     207            int newLeft = clickedLeft + xDiff;
    198208            if (newLeft>=0 && (right-newLeft)>=minimalWidth) {
    199209                left = newLeft;
    200210            }
    201211        } else if (mouseMode==MOUSE_RESIZE_RIGHT) {
    202             int newRight = right + xDiff;
     212            int newRight = clickedRight + xDiff;
    203213            int screenWidth = XPLMGetDatai(widthDataRef);
    204214            if (newRight<screenWidth && (newRight-left)>=minimalWidth) {
     
    209219        XPLMSetWindowGeometry(windowID, left, top, right, bottom);
    210220
    211         clickedX = x;
    212         clickedY = y;
     221        // clickedX = x;
     222        // clickedY = y;
    213223    }
    214224
Note: See TracChangeset for help on using the changeset viewer.