Skip to content

Conversation

@fank
Copy link
Member

@fank fank commented Feb 3, 2026

Summary

  • Fixes ELLIPSE markers being rendered larger than their in-game size
  • ELLIPSE markers now use the same coordinate conversion as RECTANGLE markers

Problem

ELLIPSE markers used an arbitrary calculation:

let rad = this._size[0] * 0.015 * window.multiplier;

This magic number 0.015 didn't correctly convert Arma meters to Leaflet map units, resulting in markers appearing larger than in-game.

Additionally, only size[0] was used, making all ellipses circular regardless of their actual dimensions.

Solution

Changed ELLIPSE to use the same approach as RECTANGLE:

  1. Calculate perimeter points in Arma coordinates (meters)
  2. Convert each point via armaToLatLng()
  3. Apply rotation using existing _rotatePoints() method
  4. Render as L.polygon instead of L.circle

This ensures ellipses:

  • Match their in-game size exactly
  • Support true ellipse shapes (different X and Y radii)
  • Support rotation (marker direction)

Test plan

  • Load a recording with ELLIPSE markers
  • Compare marker size in web replay vs in-game screenshot
  • Verify ellipse rotation works correctly
  • Verify ellipse opacity/alpha works correctly

fank added 2 commits February 3, 2026 12:11
ELLIPSE markers were rendered larger than in-game due to incorrect
size calculation using an arbitrary 0.015 constant.

Changes:
- Calculate ellipse perimeter points in Arma coordinates (meters)
- Convert points to latLng using existing armaToLatLng function
- Render as L.polygon instead of L.circle for proper ellipse support
- Use both size[0] (X radius) and size[1] (Y radius) for true ellipses
- Apply rotation using existing _rotatePoints method

This aligns ELLIPSE rendering with RECTANGLE, which already correctly
converts Arma coordinates to map coordinates.
- Include ELLIPSE shape in updateRender method (was only RECTANGLE)
- Add defensive checks for this._size array access to prevent silent
  errors when size data is malformed
@fank fank merged commit d2b90d3 into main Feb 3, 2026
2 checks passed
@fank fank deleted the fix/ellipse-marker-size branch February 3, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants