MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / lightModeRedraw

Function lightModeRedraw

src/Components/WorldMap/display.js:205–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203}
204
205function lightModeRedraw() {
206 flights = flights.filter(flight => flight.tail_progrss < flight.total);
207 genNewFlight();
208
209 const now = Date.now();
210 const fps = 1000 / (now - lastTimestamp);
211 lastTimestamp = now;
212
213 const all_plane_info = flights.map(flight => {
214 return drawFlight(ctx, projection, flight, fps);
215 });
216
217 all_plane_info.forEach(plane_info => {
218 const [x, y, direction, opacity, display] = plane_info;
219 if (display) {
220 ctx.save();
221 ctx.translate(x, y);
222 ctx.rotate(direction);
223 ctx.globalAlpha = opacity;
224 ctx.drawImage(img, -10 * proportion, -10 * proportion, 20 * proportion, 20 * proportion);
225 ctx.restore();
226 }
227 });
228
229 ctx.beginPath();
230 ctx.arc(...shanghai_projected, 5 * proportion, 0, 2 * Math.PI);
231 ctx.fillStyle = "#C25451";
232 ctx.fill();
233}
234
235function darkModeRedraw() {
236 UnivList.forEach(univ => {

Callers 1

redrawFunction · 0.85

Calls 2

genNewFlightFunction · 0.85
drawFlightFunction · 0.85

Tested by

no test coverage detected