Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Tools - Fix Straight Line Drawing being broken by Higher Draw Priority #10635

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions addons/maptools/XEH_postInitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if (!hasInterface) exitWith {};
// Init variables
GVAR(mapGpsShow) = true;
GVAR(mapGpsNextUpdate) = -1;
GVAR(lastDrawnLine) = "";

GVAR(mapTool_Shown) = 0;
GVAR(mapTool_pos) = [0, 0];
Expand Down Expand Up @@ -47,6 +48,12 @@ GVAR(plottingBoard_markers) = createHashMap;

addMissionEventHandler ["MarkerCreated", {
[_this, false] call FUNC(handlePlottingBoardMarkers);

// Cache last user-drawn polyline marker
private _marker = _this select 0;
if ((markerPolyline _marker) isNotEqualTo []) then {
GVAR(lastDrawnLine) = _marker;
};
}];

addMissionEventHandler ["MarkerDeleted", {
Expand Down
2 changes: 1 addition & 1 deletion addons/maptools/functions/fnc_handleMouseButton.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if ((_button == 0) && {GVAR(freedrawing) || _ctrlKey}) exitWith {

if (_allMarkers isEqualTo []) exitWith {};

private _markerName = _allMarkers select -1;
private _markerName = GVAR(lastDrawnLine);
private _markerPos = getMarkerPos _markerName;
private _distanceCheck = _markerPos distance2D GVAR(drawPosStart);

Expand Down
Loading