mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 16:10:53 +00:00
d1651017ea
The shift+drag warship selection rectangle was drawn on a second offscreen canvas, blitted onto the main canvas2D context every frame via world-coord transform. It's a screen-space rectangle though, so none of that math was load-bearing. Replace with a `<div>` positioned via inline left/top/width/height in screen pixels. Same color tinting (player territoryColor lightened 0.2, dashed border at 0.85 alpha, fill at 0.06). pointer-events:none so it doesn't intercept the drag. Drops ~95 LOC of canvas2D drawing (renderSelectionBox, drawDashedLine, selectionBoxCanvas/Ctx, the redraw() init, the renderLayer() blit). One step closer to retiring the canvas2D map canvas — UILayer's per-unit selection outlines are the last canvas2D draws on it.