Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset NSEW labels when switching Northern/Southern Hemispheres #27

Merged
merged 1 commit into from
Aug 14, 2024
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
7 changes: 6 additions & 1 deletion src/BlazeStarNova.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ import {throttle} from './debounce';

import { equatorialToHorizontal } from "./utils";
import { EquatorialRad, LocationRad } from "./types";
import { makeAltAzGridText, setupConstellationFigures, renderOneFrame } from "./wwt-hacks";
import { resetAltAzGridText, makeAltAzGridText, setupConstellationFigures, renderOneFrame } from "./wwt-hacks";

import { usePlaybackControl } from "./wwt_playback_control";
import { useTimezone } from "./timezones";
Expand Down Expand Up @@ -480,6 +480,9 @@ const ready = computed(() => layersLoaded.value && positionSet.value);
/* `isLoading` is a bit redundant here, but it could potentially have independent logic */
const isLoading = computed(() => !ready.value);

// It doesn't really matter which one we note here
const inNorthernHemisphere = computed(() => selectedLocation.value.latitudeDeg > 0);

function getCrbAlt(when: Date | null = null) {
const location = getWWTLocation();
const crbAltAz = equatorialToHorizontal(
Expand Down Expand Up @@ -650,6 +653,8 @@ watch(selectedLocation, (location: LocationDeg) => {
WWTControl.singleton.renderOneFrame();
});

watch(inNorthernHemisphere, (_inNorth: boolean) => resetAltAzGridText());

</script>

<style lang="less">
Expand Down
4 changes: 4 additions & 0 deletions src/wwt-hacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import {
import { drawHorizon, drawSky } from "./horizon_sky";
import { makeTextOverlays } from "./text";

export function resetAltAzGridText() {
Grids._altAzTextBatch = null;
}

export function makeAltAzGridText() {
if (Grids._altAzTextBatch == null) {
const glyphHeight = 70;
Expand Down
Loading