Skip to content
Merged
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
2 changes: 1 addition & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-timer/mobile",
"version": "1.1.35",
"version": "1.1.36",
"private": true,
"main": "index.js",
"scripts": {
Expand Down
48 changes: 18 additions & 30 deletions apps/mobile/src/utils/photographyGuide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,9 @@ function buildLandscapeCompositeLayoutFallback(
sunRadius,
travelVector,
});
const moonOffsetX = moonGeometry.moonCenterX - moonGeometryStageSize / 2;
const moonOffsetY = moonGeometry.moonCenterY - moonGeometryStageSize / 2;
moon = {
x: clampedX + moonOffsetX,
y: clampedY + moonOffsetY,
x: clampedX + moonGeometry.moonOffsetX,
y: clampedY + moonGeometry.moonOffsetY,
radius: moonGeometry.moonRadius,
};
}
Expand Down Expand Up @@ -473,6 +471,7 @@ export function buildLandscapeCompositeLayout(
frameWidth,
frameHeight,
);
const travelVector = normalizeTravelVector(input.travelVector);
const rawHorizonY = anchorY + (maxSunAltitudeDeg / LANDSCAPE_VERTICAL_FOV_DEG_24MM) * frameHeight;
const horizonY = clampRange(rawHorizonY, 0, frameHeight);

Expand All @@ -497,8 +496,6 @@ export function buildLandscapeCompositeLayout(
const rawY = anchorY - (altitudeDeltaDeg / LANDSCAPE_VERTICAL_FOV_DEG_24MM) * frameHeight;
const clampedX = clampRange(rawX, minX, maxX);
const clampedY = clampRange(rawY, minY, maxY);
const clampedDeltaX = clampedX - rawX;
const clampedDeltaY = clampedY - rawY;
const clamped = Math.abs(clampedX - rawX) > 0.01 || Math.abs(clampedY - rawY) > 0.01;

let moon:
Expand All @@ -509,30 +506,21 @@ export function buildLandscapeCompositeLayout(
}
| undefined;
if (row.showMoon) {
const moonRadius = bodyAngularRadiusDegToPixels(
sample.moon.angularRadiusDeg,
frameWidth,
frameHeight,
);
const moonAzimuthDeltaDeg = normalizeSignedDeltaDeg(maxSunAzimuthDeg, sample.moon.azimuthDeg);
const moonAltitudeDeltaDeg = sample.moon.altitudeDeg - maxSunAltitudeDeg;
const moonX =
anchorX +
(moonAzimuthDeltaDeg / LANDSCAPE_HORIZONTAL_FOV_DEG_24MM) * frameWidth +
clampedDeltaX;
const moonY =
anchorY -
(moonAltitudeDeltaDeg / LANDSCAPE_VERTICAL_FOV_DEG_24MM) * frameHeight +
clampedDeltaY;
const centerDistance = Math.hypot(moonX - clampedX, moonY - clampedY);
const isOccluding = centerDistance <= sunRadius + moonRadius + 0.25;
if (isOccluding) {
moon = {
x: moonX,
y: moonY,
radius: moonRadius,
};
}
const moonGeometryStageSize = Math.max(64, sunRadius * LANDSCAPE_MOON_GEOMETRY_STAGE_FACTOR);
const moonGeometry = calculatePreviewMoonGeometry({
progress: row.progress,
kindAtLocation: input.kindAtLocation,
magnitude: input.magnitude,
contacts: input.schedule.contacts,
stageSize: moonGeometryStageSize,
sunRadius,
travelVector,
});
moon = {
x: clampedX + moonGeometry.moonOffsetX,
y: clampedY + moonGeometry.moonOffsetY,
radius: moonGeometry.moonRadius,
Comment thread
c0d3rb4b4 marked this conversation as resolved.
};
}

return {
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/src/utils/previewGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type PreviewMoonGeometry = {
moonCenterX: number;
moonCenterY: number;
moonOffsetX: number;
moonOffsetY: number;
moonTravelHalfSpan: number;
};

Expand Down Expand Up @@ -232,6 +233,7 @@ export function calculatePreviewMoonGeometry(params: {
moonCenterX,
moonCenterY,
moonOffsetX,
moonOffsetY,
moonTravelHalfSpan: sunRadius + moonRadius,
};
}
8 changes: 8 additions & 0 deletions apps/mobile/tests/photography-guide.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ describe("photography guide schedule", () => {
expect(placement.sunRadius).toBeLessThan(4);
expect(placement.sunRadius).toBeGreaterThan(1);
expect(placement.y + placement.sunRadius).toBeLessThanOrEqual(layout.horizonY);
expect(placement.showMoon).toBe(true);
expect(placement.moon).toBeDefined();
if (!placement.moon) continue;
const centerDistance = Math.hypot(
placement.moon.x - placement.x,
placement.moon.y - placement.y,
);
expect(centerDistance).toBeLessThan(placement.sunRadius * 2.5);
}
});
});
8 changes: 8 additions & 0 deletions documents/reference/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable updates documented under `documents/` are tracked here.
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.36] — 2026-02-26

### Fixed
- Corrected Photography Guide landscape composite rendering so moon occlusion aligns with shot schedule previews for eclipse phases.

### Changed
- Bumped `apps/mobile/package.json` version from `1.1.35` to `1.1.36`.

## [1.0.1] — 2026-02-19

### Added
Expand Down