Use polyline marker for straight lines (#9174)

This commit is contained in:
BaerMitUmlaut 2023-04-03 19:18:47 +02:00 committed by GitHub
parent f1fc0df6ef
commit 4aa8d59701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,18 +40,11 @@ if ((_button == 0) && {GVAR(freedrawing) || _ctrlKey}) exitWith {
if ((count GVAR(freeDrawingData)) != 3) exitWith {TRACE_1("never touched roamer",GVAR(freeDrawingData));};
GVAR(freeDrawingData) params ["", "_startStraightPos", "_endStraightPos"];
_startStraightPos set [2, 0];
_endStraightPos set [2, 0];
// Convert marker to rectangle and change it's pos/size/dir
_markerName setMarkerShape "RECTANGLE";
private _difPos = _endStraightPos vectorDiff _startStraightPos;
private _mag = vectorMagnitude _difPos;
_markerName setMarkerPos (_startStraightPos vectorAdd (_difPos vectorMultiply 0.5));
_markerName setMarkerSize [10, _mag / 2];
_markerName setMarkerDir (_difPos call CBA_fnc_vectDir);
_markerName setMarkerPolyline [
_startStraightPos#0, _startStraightPos#1,
_endStraightPos#0, _endStraightPos#1
];
}, []] call CBA_fnc_execNextFrame;
} else {
if (_ctrlKey && {_dir == 1}) then {