MCPcopy Create free account
hub / github.com/codecombat/codecombat / mapToSvgX

Method mapToSvgX

app/views/play/CampaignView.js:1544–1544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1542 // X is from left; Y is from bottom (like level positions), so we flip it
1543 // before mapping into the SVG's top-left–based pixel space.
1544 const mapToSvgX = xPercent => (xPercent / 100) * mapWidth
1545 const mapToSvgY = yPercentFromBottom => {
1546 const yPercentFromTop = 100 - yPercentFromBottom
1547 return (yPercentFromTop / 100) * mapHeight

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected