From 0ab38b84a3a1e1f6a6759cb85562c9f5ac59e835 Mon Sep 17 00:00:00 2001 From: BaerMitUmlaut Date: Fri, 24 Mar 2023 19:35:23 +0100 Subject: [PATCH] Use polyline marker for straight lines --- .../maptools/functions/fnc_handleMouseButton.sqf | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 4e1c124b2a1..3d7888b0032 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -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 {