Skip to content

Commit

Permalink
fixed daytime rows preview image
Browse files Browse the repository at this point in the history
  • Loading branch information
jdvlpr committed Feb 7, 2025
1 parent 4005450 commit c3977e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "temperature-blanket-web-app",
"version": "4.19.0",
"version": "4.19.1",
"description": "Weather Data + Art! Web app for creating a temperature blanket",
"main": "index.html",
"private": true,
Expand Down
23 changes: 12 additions & 11 deletions src/lib/components/previews/DaytimeRowsPreview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ If not, see <https://www.gnu.org/licenses/>. -->
sectionIndex < $weather?.length;
sectionIndex++, dayIndex++, y += STITCH_SIZE
) {
const daytime = displayNumber(
($weather[dayIndex].dayt['imperial'] / HOURS_PER_DAY) * width,
);
const daytimeLength = displayNumber(
($weather[dayIndex].dayt['imperial'] * $settings.stitchesPerRow) / HOURS_PER_DAY,
0,
) * STITCH_SIZE;
const _day = [];
for (
let paramIndex = 0, x = 0;
Expand All @@ -96,23 +97,23 @@ If not, see <https://www.gnu.org/licenses/>. -->
let calcWidth;
switch ($settings.daytimePosition) {
case 'left':
if (paramIndex === 0) calcWidth = daytime;
if (paramIndex === 1) calcWidth = width - daytime;
if (paramIndex === 0) calcWidth = daytimeLength;
if (paramIndex === 1) calcWidth = width - daytimeLength;
break;
case 'right':
if (paramIndex === 0) calcWidth = width - daytime;
if (paramIndex === 1) calcWidth = daytime;
if (paramIndex === 0) calcWidth = width - daytimeLength;
if (paramIndex === 1) calcWidth = daytimeLength;
break;
case 'center':
if (paramIndex === 0 || paramIndex === 2)
calcWidth = (width - daytime) / 2;
if (paramIndex === 1) calcWidth = daytime;
calcWidth = (width - daytimeLength) / 2;
if (paramIndex === 1) calcWidth = daytimeLength;
// if (paramIndex === 0 || paramIndex === 2) calcWidth = daytime / 2;
// if (paramIndex === 1) calcWidth = width - daytime;
break;
case 'sides':
if (paramIndex === 0 || paramIndex === 2) calcWidth = daytime / 2;
if (paramIndex === 1) calcWidth = width - daytime;
if (paramIndex === 0 || paramIndex === 2) calcWidth = daytimeLength / 2;
if (paramIndex === 1) calcWidth = width - daytimeLength;
break;
}
let param = weatherParams[paramIndex];
Expand Down
10 changes: 10 additions & 0 deletions src/routes/changelog/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ import type { ChangelogItem } from '$lib/types';
export const entries: ChangelogItem[] = [
{
date: 'February, 2025',
notes: [
{
icon: ICONS.wrench,
text: `The Daytime Rows preview image was inaccurately representing the number of daytime and night stitches in each row. This update uses the actual daytime and night stitches values to generate the preview image, ensuring that it accurately reflects the values in the stitches table. Consequently, the apparent line between the daytime and night sections in the preview image may appear more jagged (less of a smooth curve). However, it provides a more precise representation of the final project's appearance. Only the Daytime Rows preview image in the Project Planner is affected by this update; preview images on Project Gallery pages created before this update remain unchanged.`,
title: 'Fixed Daytime Rows Preview Image',
},
],
version: '4.19.1',
},
{
notes: [
{
icon: ICONS.checkCircle,
Expand Down

0 comments on commit c3977e2

Please sign in to comment.