fix crop selection from elevation profile, and improve for dark mode, closes #41

This commit is contained in:
vcoppe
2024-08-05 18:16:28 +02:00
parent 4eb09f26c7
commit 6f946a0075
2 changed files with 9 additions and 2 deletions

View File

@@ -40,6 +40,7 @@
import { DateFormatter } from '@internationalized/date';
import type { GPXStatistics } from 'gpx';
import { settings } from '$lib/db';
import { mode } from 'mode-watcher';
export let gpxStatistics: Writable<GPXStatistics>;
export let slicedGPXStatistics: Writable<[GPXStatistics, number, number] | undefined>;
@@ -525,7 +526,8 @@
// Draw selection rectangle
let selectionContext = overlay.getContext('2d');
if (selectionContext) {
selectionContext.globalAlpha = 0.1;
selectionContext.fillStyle = $mode === 'dark' ? 'white' : 'black';
selectionContext.globalAlpha = $mode === 'dark' ? 0.2 : 0.1;
selectionContext.clearRect(0, 0, overlay.width, overlay.height);
let startPixel = chart.scales.x.getPixelForValue(