Skip to content

Commit

Permalink
Fix dragging position on mouse wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Jun 2, 2017
1 parent 5b9c70a commit df147b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/dragging/functions/fnc_handleScrollWheel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5))

// move up/down object and reattach at current position
detach _carriedItem;
_carriedItem setPosATL _position;
_carriedItem attachTo [_unit];

private _positionChange = _position vectorDiff (getPosATL _carriedItem);
private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _carriedItem);
_selectionPosition = _selectionPosition vectorAdd _positionChange;
_carriedItem attachTo [_unit, _selectionPosition];

//reset the carry direction
private _direction = _carriedItem getVariable [QGVAR(carryDirection), 0];
Expand Down

0 comments on commit df147b8

Please sign in to comment.